4
很多映射我有(用流利API)User
類與類之間Product
使用ProductXUser
類的三大類EF代碼優先許多使用現有的映射類
public class User
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<User> Users { get; set; }
}
public class ProductXUser // Mapping class
{
public int Id { get; set; }
public int User_Id { get; set; }
public int Product_Id { get; set; }
public DateTime DateMapped { get; set; }
}
我怎麼能一個不少映射到一對多的關係映射表?