Entity Key mapping bug

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 09 Jul 2009 12:53

If you use Entity Developer, you can do these operations in design time.
Go to Project Explorer, open the Model.Store part, find the necessary table, and for each property not participating in the key
set the Entity Key property to false. Then make the same operation for the properties in the Model part.
If you use the .edmx model then go to the Solution Explorer.
Right-click on the model, choose the Open With... option.
Open the model with XML Editor.
Find the necessary tag in the SSDL part of the model, and remove properties not particiating in the key
from the tag. Then repeat this operation for tag in the CSDL part.

danielliu8
Posts: 33
Joined: Wed 17 Jun 2009 22:59
Location: ca

Post by danielliu8 » Thu 09 Jul 2009 17:07

Thanks, Andrey.

I edited .edmx file successfully. I am able to update data using this way for now.

In SSDL part, there are many warnings like following:


So your product only checked the primary key, did nto checked the unique index if primary key not defined.

Suggestion for your next release:

1. check primary key. If any, set entity key on primary key.

2. if no primary key found, then check unique index. if any, set entity key on unique index.

3. only if none of primary key and unique index found in the table, you could infer the entity keys over the not-null columns.

Thank you very much for your support.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 10 Jul 2009 07:46

Entity Developer implements the scenario you have described.
Unfortunately, there is no technical possibility to change the behaviour of the Entity Data Model Wizard.

danielliu8
Posts: 33
Joined: Wed 17 Jun 2009 22:59
Location: ca

Post by danielliu8 » Fri 10 Jul 2009 15:47

thanks a lot for your support. We will check other options to fix our problem.

Post Reply