EF Core 现在不支持多对多映射,只能做2个一对多映射. 比如Product和Category 我现在定义Product和Category是多对多关系. 那么实体定义如下: public class Product { [Key] public int ProdId{ get; set; } public String ProdCode{ get; set; } public String ProdName{ get; set; } public IList<CategoryProduct>…
问题一:Add-Migration 时出现 此类问题一般都是模型类主键标识问题增加KEY即可解决 报错: The entity type 'xxxx' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see ht…