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.
Entity Key mapping bug
-
danielliu8
- Posts: 33
- Joined: Wed 17 Jun 2009 22:59
- Location: ca
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.
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.
-
danielliu8
- Posts: 33
- Joined: Wed 17 Jun 2009 22:59
- Location: ca