Guest User

Untitled

a guest
Dec 4th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class Station : IEntitie
  2. {
  3. [Key]
  4. public int Id { get; set; }
  5.  
  6. public string Description { get; set; }
  7. }
  8.  
  9.  
  10. public class OperativeSchedule : IEntitie
  11. {
  12. [Key]
  13. public int Id { get; set; }
  14.  
  15. public virtual Station DispatchStation { get; set; } //для таблицы station надо задать ключ
  16. public virtual Station StationOfDestination { get; set; } //для таблицы station надо задать ключ
  17. }
  18.  
  19. modelBuilder.Entity<Product>()
  20. .HasOptional(p => p.Category)
  21. .WithMany()
  22. .WillCascadeOnDelete(true);
Add Comment
Please, Sign In to add comment