File tree Expand file tree Collapse file tree 11 files changed +18
-18
lines changed
CodeTemplates/CSharpEntityType/Partials
src/EntityFrameworkCore.Scaffolding.Handlebars/CodeTemplates/CSharpEntityType/Partials Expand file tree Collapse file tree 11 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1111{{ spaces 8 }}{{{ nav-property-annotation }}}
1212{{ /each }}
1313{{ #if nav-property-collection }}
14- {{ spaces 8 }} public ICollection<{{nav-property-type}} > {{ nav-property-name }} { get; set; }
14+ {{ spaces 8 }} public virtual ICollection<{{nav-property-type}} > {{ nav-property-name }} { get; set; }
1515{{ else }}
16- {{ spaces 8 }} public {{ nav-property-type }} {{ nav-property-name }} { get; set; }
16+ {{ spaces 8 }} public virtual {{ nav-property-type }} {{ nav-property-name }} { get; set; }
1717{{ /if }}
1818{{ /each }}
1919{{ /if }}
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ public Category()
1313 public int CategoryId { get ; set ; }
1414 public string CategoryName { get ; set ; }
1515
16- public ICollection < Product > Product { get ; set ; }
16+ public virtual ICollection < Product > Product { get ; set ; }
1717 }
1818}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public Customer()
1616 public string City { get ; set ; }
1717 public Country Country { get ; set ; }
1818
19- public CustomerSetting CustomerSetting { get ; set ; }
20- public ICollection < Order > Order { get ; set ; }
19+ public virtual CustomerSetting CustomerSetting { get ; set ; }
20+ public virtual ICollection < Order > Order { get ; set ; }
2121 }
2222}
Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ public partial class CustomerSetting // My Handlebars Helper
88 public string CustomerId { get ; set ; }
99 public string Setting { get ; set ; }
1010
11- public Customer Customer { get ; set ; }
11+ public virtual Customer Customer { get ; set ; }
1212 }
1313}
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ public Employee()
1818 public string City { get ; set ; }
1919 public Country Country { get ; set ; }
2020
21- public ICollection < EmployeeTerritories > EmployeeTerritories { get ; set ; }
21+ public virtual ICollection < EmployeeTerritories > EmployeeTerritories { get ; set ; }
2222 }
2323}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public partial class EmployeeTerritories // My Handlebars Helper
88 public int EmployeeId { get ; set ; }
99 public string TerritoryId { get ; set ; }
1010
11- public Employee Employee { get ; set ; }
12- public Territory Territory { get ; set ; }
11+ public virtual Employee Employee { get ; set ; }
12+ public virtual Territory Territory { get ; set ; }
1313 }
1414}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public Order()
1717 public int ? ShipVia { get ; set ; }
1818 public decimal ? Freight { get ; set ; }
1919
20- public Customer Customer { get ; set ; }
21- public ICollection < OrderDetail > OrderDetail { get ; set ; }
20+ public virtual Customer Customer { get ; set ; }
21+ public virtual ICollection < OrderDetail > OrderDetail { get ; set ; }
2222 }
2323}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public partial class OrderDetail // My Handlebars Helper
1212 public short Quantity { get ; set ; }
1313 public float Discount { get ; set ; }
1414
15- public Order Order { get ; set ; }
16- public Product Product { get ; set ; }
15+ public virtual Order Order { get ; set ; }
16+ public virtual Product Product { get ; set ; }
1717 }
1818}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public Product()
1717 public bool Discontinued { get ; set ; }
1818 public byte [ ] RowVersion { get ; set ; }
1919
20- public Category Category { get ; set ; }
21- public ICollection < OrderDetail > OrderDetail { get ; set ; }
20+ public virtual Category Category { get ; set ; }
21+ public virtual ICollection < OrderDetail > OrderDetail { get ; set ; }
2222 }
2323}
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ public Territory()
1313 public string TerritoryId { get ; set ; }
1414 public string TerritoryDescription { get ; set ; }
1515
16- public ICollection < EmployeeTerritories > EmployeeTerritories { get ; set ; }
16+ public virtual ICollection < EmployeeTerritories > EmployeeTerritories { get ; set ; }
1717 }
1818}
You can’t perform that action at this time.
0 commit comments