This commit is contained in:
@@ -123,8 +123,11 @@ namespace AyaNova.Models
|
|||||||
.WithOne(i => i.User)
|
.WithOne(i => i.User)
|
||||||
.HasForeignKey<Widget>(b => b.UserId)
|
.HasForeignKey<Widget>(b => b.UserId)
|
||||||
.OnDelete(DeleteBehavior.NoAction);
|
.OnDelete(DeleteBehavior.NoAction);
|
||||||
|
|
||||||
|
//Workorder
|
||||||
|
modelBuilder.Entity<WorkOrderItem>()
|
||||||
|
.HasOne(p => p.WorkOrder)
|
||||||
|
.WithMany(b => b.WorkorderItems);
|
||||||
|
|
||||||
|
|
||||||
//-----------
|
//-----------
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace AyaNova.Models
|
|||||||
// public ICollection<TranslationItem> TranslationItems { get; set; }
|
// public ICollection<TranslationItem> TranslationItems { get; set; }
|
||||||
|
|
||||||
//Not perhaps so useful here but this is a good way to lazy initialize collections which
|
//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 (workorder) and means no need to null check the collection
|
//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
|
//https://stackoverflow.com/a/20773057/8939
|
||||||
|
|
||||||
private ICollection<TranslationItem> _translationItem;
|
private ICollection<TranslationItem> _translationItem;
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ namespace AyaNova.Models
|
|||||||
public string CustomFields { get; set; }
|
public string CustomFields { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
|
//dependents
|
||||||
|
public List<WorkOrderItem> WorkorderItems { get; set; }
|
||||||
|
|
||||||
public WorkOrder()
|
public WorkOrder()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,20 +8,25 @@ namespace AyaNova.Models
|
|||||||
{
|
{
|
||||||
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
|
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
|
||||||
//otherwise the server will call it an invalid record if the field isn't sent from client
|
//otherwise the server will call it an invalid record if the field isn't sent from client
|
||||||
|
|
||||||
public partial class WorkOrderItem
|
public partial class WorkOrderItem
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint ConcurrencyToken { get; set; }
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
public string Notes { get; set; }
|
public string Notes { get; set; }
|
||||||
public string Wiki {get;set;}
|
public string Wiki { get; set; }
|
||||||
public string CustomFields { get; set; }
|
public string CustomFields { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public List<string> Tags { get; set; }
|
||||||
|
|
||||||
|
//Principle
|
||||||
|
public int WorkorderId { get; set; }//fk
|
||||||
|
public WorkOrder WorkOrder { get; set; }
|
||||||
|
|
||||||
|
//Dependents
|
||||||
|
|
||||||
public WorkOrderItem()
|
public WorkOrderItem()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user