I am trying to create a many-to-many relationship between ApplicationUser and Reserve.
public class ApplicationUser : IdentityUser
{
public ApplicationUser()
{
this.Reserves = new HashSet<Reserve>();
}
public bool IsProfessional { get; set; }
public virtual ICollection<Reserve> Reserves { get; set; }
}
public class Reserve
{
public Reserve()
{
this.Usuarios = new HashSet<ApplicationUser>();
}
public int ID { get; set; }
public string Begin { get; set; }
public string End { get; set; }
public string Date { get; set; }
public string Status { get; set; } //free , reserved, confirmed, canceled
public DateTime LastUpdate { get; set; }
public virtual ICollection<ApplicationUser> Usuarios { get; set; }
}
But I cant add the migration
PM> Add-Migration user-reserve-relationship
Unable to determine the relationship represented by navigation property 'ApplicationUser.Reserves' of type 'ICollection<Reserve>'. Either manually configure the relationship, or ignore this property from the model.
Anyway, the same relationship works well to others entities but not ApplicationUser.
Can I use ApplicationUser many-to-many?
I found the follow in ef core : Many-to-many relationships without an entity class to represent the join table are not yet supported. So my question is closed.