Guest User

Untitled

a guest
Feb 17th, 2019
100
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 Course
  2. {
  3. public int Id {get; set;}
  4. public Curriculum { get; set; }
  5. }
  6.  
  7.  
  8. public class Curriculum
  9. {
  10. [ForeignKey("Course")]
  11. public int Id { get; set; }
  12.  
  13. pubic Course Course { get; set; }
  14. }
  15.  
  16. public class CourseConfiguration : EntityTypeConfiguration<Course>
  17. {
  18. public CourseConfiguration()
  19. {
  20. HasOptional(course => course.Curriculum)
  21. .WithRequired(cur => cur.Course);
  22. }
  23. }
Add Comment
Please, Sign In to add comment