entity framework - Table per Concrete Type Mapping Issue in EF Code First 4.2 -


I do not have a defined key of EntityType 'user' key for this EntityType error Define.

Model:

  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

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -