Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. public class Customer
  2. {
  3.     public Customer
  4.     {
  5.         this.Orders = new HashSet<Orders>();
  6.     }
  7.  
  8.     public int Id {get; set;}
  9.  
  10.     public virtual ICollection<Order> Orders{ get; set; }
  11. }
  12.  
  13. public class Order
  14. {
  15.     public int Id {get; set;}
  16.  
  17.     public Customer Customer { get; set; }
  18.  
  19.     [ForeignKey("Customer ")]
  20.     public int? CustomerId { get; set; }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement