This commit is contained in:
@@ -124,7 +124,10 @@ namespace AyaNova.Models
|
||||
.HasForeignKey<Widget>(b => b.UserId)
|
||||
.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; }
|
||||
|
||||
//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
|
||||
|
||||
private ICollection<TranslationItem> _translationItem;
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace AyaNova.Models
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; }
|
||||
|
||||
//dependents
|
||||
public List<WorkOrderItem> WorkorderItems { get; set; }
|
||||
|
||||
public WorkOrder()
|
||||
{
|
||||
|
||||
@@ -22,6 +22,11 @@ namespace AyaNova.Models
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; }
|
||||
|
||||
//Principle
|
||||
public int WorkorderId { get; set; }//fk
|
||||
public WorkOrder WorkOrder { get; set; }
|
||||
|
||||
//Dependents
|
||||
|
||||
public WorkOrderItem()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user