This commit is contained in:
2020-06-24 19:01:08 +00:00
parent b4e1f4cf92
commit b177bfefaf
4 changed files with 57 additions and 31 deletions

View File

@@ -5,23 +5,33 @@ using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
namespace AyaNova.Models
{
{
public class Translation
{
// public Translation() { }
// public Translation(Translation t)
// {
// Id = t.Id;
// Concurrency = t.Concurrency;
// Name = t.Name;
// CjkIndex = t.CjkIndex;
// _translationItems = new List<TranslationItem>();
// foreach (var titem in t.TranslationItems)
// {
// _translationItems.Add(new TranslationItem(titem));
// }
// }
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Name { get; set; }
public bool? Stock { get; set; }
public bool CjkIndex { get; set; }
//TODO: Defaults for user options translation settings:
// short date, short time formats
// currency symbol
//digit grouping separator symbol
//decimal symbol
//Relationship
@@ -32,12 +42,12 @@ namespace AyaNova.Models
//is more efficient when there are many child collections (but when would that ever be desired for AyaNova?)and means no need to null check the collection
//https://stackoverflow.com/a/20773057/8939
private ICollection<TranslationItem> _translationItem;
private ICollection<TranslationItem> _translationItems;
public virtual ICollection<TranslationItem> TranslationItems
{
get
{
return this._translationItem ?? (this._translationItem = new HashSet<TranslationItem>());
return this._translationItems ?? (this._translationItems = new HashSet<TranslationItem>());
}
}