entity framework - Table per Concrete Type Mapping Issue in EF Code First 4.2 -
I do not have a defined key of Model: EntityType 'user' key for this EntityType error Define.
Public Essentials KeyedEntityBase {Public Int ID {get; Private set; }} Public class user: KeyedEntityBase {public string username {get; Private set; } Receive public string email address { Private set; Public Lisbon PortalContext: DBCTTEX {Public LSB PortTaintex (): Base ("LSB PortraitDB") {} Public DBSet & lt; Users & gt; User {Received; Set; } Safe Override Zero OnModelCreating (DbModelbuilder Modalbuilder) {modelBuilder.Entity & lt; Users & gt; (). Map (M = & gt; {M.map Inherited Properties}; M.Totable ("user");}); Base.OnModelCreating (modelBuilder); The problem was that I did not actually map the KeyedEntityBase class. Once I did that all this worked well.
Comments
Post a Comment