Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. builder.Entity<Project>()
  2.                 .HasMany<ApplicationUser>(x => x.Users)
  3.                 .WithMany(x => x.Projects)
  4.                 .Map(m =>
  5.                 {
  6.                     m.ToTable("UserToProject");
  7.                     m.MapLeftKey("ProjectId");
  8.                     m.MapRightKey("UserId");
  9.                 });
  10.  
  11.             builder.Entity<ApplicationUser>()
  12.                 .HasMany<ProjectTask>(x => x.ProjectTasks)
  13.                 .WithMany(x => x.Users)
  14.                 .Map(m =>
  15.                 {
  16.                     m.ToTable("UserToTask");
  17.                     m.MapLeftKey("UserId");
  18.                     m.MapRightKey("TaskId");
  19.                 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement