58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
|
|
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; }
|
|
|
|
|
|
|
|
//Relationship
|
|
//was this but..
|
|
// public ICollection<TranslationItem> TranslationItems { get; set; }
|
|
|
|
//Not perhaps so useful here but this is a good way to lazy initialize collections which
|
|
//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> _translationItems;
|
|
public virtual ICollection<TranslationItem> TranslationItems
|
|
{
|
|
get
|
|
{
|
|
return this._translationItems ?? (this._translationItems = new HashSet<TranslationItem>());
|
|
}
|
|
}
|
|
|
|
|
|
}//eoc
|
|
|
|
}//eons
|