简体   繁体   中英

What should be the mapping for listed tables in Entity Framework (edmx)

I have a 3 tables 1. Entity 2. Credentials 3. EntityType

Entity can be Lab, Client or Technician based on EntityType value that can be (1,2,3). Only Technician ie 3 can have credentials.

What should I make changes to get into the required design.

在此处输入图片说明

I am getting following error.

Error 1 Error 3032: Problem in mapping fragments starting at line 149:Condition member 'Entity.EntityType' with a condition other than 'IsNull=False' is mapped. Either remove the condition on Entity.EntityType or remove it from the mapping. c:\\documents and settings\\administrator\\my documents\\visual studio 2010\\Projects\\LimsEdm\\LimsEdmx\\LimsModel.edmx 150 15 LimsEdmx

If you are using EntityType column for TPH discriminator you cannot map it in the table. It is already used for inheritance mapping and column cannot be mapped twice. Remove EntityType property from your EntityType entity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM