Skip to content

Commit 58d94f1

Browse files
author
Anthony Sneed
committed
Make navigation properties virtual.
1 parent bb15d5d commit 58d94f1

File tree

11 files changed

+18
-18
lines changed

11 files changed

+18
-18
lines changed

sample/ScaffoldingSample/CodeTemplates/CSharpEntityType/Partials/Properties.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
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}}

sample/ScaffoldingSample/Models/Category.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/Customer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/CustomerSetting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/Employee.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/EmployeeTerritories.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/Order.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/OrderDetail.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/Product.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

sample/ScaffoldingSample/Models/Territory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)