public class Band [Key] public long{ public DbSet<Band> bands { get; set; }PM> add-migration migration_1
Output: The entitytype 'Band' requires a primary <
public class Ejercicios : BaseModel private int _TipoEjercicio; public int TipoEjercicioHexBackGroundColor, value); }}System.InvalidOperationException: The entitytype 'Ejercicios' requires a p
\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'album' has no keydefined.\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'genero' has no keydefined.\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType
public DbSet<Foo> Foo { get; set; }Foo.Id映射正确,但Bar不能用此错误System.InvalidOperationException : The entitytype 'Bar' requires a primarykey to be defined.映射。
Assembly.GetExecutingAssembly());
}System.InvalidOperationException: The entitytype 'Campaign' requires a primarykey to be defined.If you intended to use a keyless entityty
当尝试从这些表中的一个读取时,我得到以下错误: System.InvalidOperationException Message=The entitytype'SqlXml' requires a primarykey to be defined.If you intended to use a keyless entitytype call 'HasNoKey()
\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'AssemblyName' has no keydefined.\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'CultureInfo' has no keydefined.\tSystem.Data.Entity.Edm.EdmEntityType: : En
Com.Contoso.Model.Expression: : EntityType 'Expression' has no keydefined.Com.Contoso.Model.ElementInit: : EntityType 'ElementInit' has no keydefined.Com.Contoso.Model.MemberInfo: : EntityType 'MemberInfo' has no keyde
for entitytype 'OwnedBaseClass' cannot be instantiated, and there is no derived entitytype in themodel that corresponds to a concrete CLR type.如果我为AA类型添加了一个DbSet (这似乎是错误的),就会得到一个错误:
The entitytype 'AA' requires