I have two tables Group
and 'User'. User can join to many groups. So I created this two objects and join them in fluent api:
public class Group
{...
public virtual ICollection<ApplicationUser> Members { get; set; }
and:
public class ApplicationUser
{...
public virtual ICollection<Group> MemberInGroups { get; set; }
And I mapped them in fluent api:
modelBuilder.Entity<Group>()
.HasMany(c => c.Members)
.WithMany(x => x.MemberInGroups)
.Map(a =>
{
a.ToTable("UsersInGroups");
a.MapLeftKey("GroupId");
a.MapRightKey("UserId");
});
How I can add here one more column in junction table like JoinDate
?