Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public class Company
  2. {
  3.  
  4. Public Company()
  5. {
  6. Products = new List<Product>();
  7.  
  8. }
  9. [Key]
  10. public int Id { get; set; }
  11.  
  12. [Required]
  13. public string Name { get; set; }
  14.  
  15. public List<Product> Products { get; set; }
  16. }
  17. public class Product
  18. {
  19. [Key]
  20. public int Id { get; set; }
  21.  
  22. [Required]
  23. public string Name { get; set; }
  24.  
  25. }
  26.  
  27. Post: ~odata/Company(1)/Products with body as List of products json.
  28. body:[{"Name":"Product1"},{"Name":"Product2"}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement