Need to specify a mapping for all key properties in the Entity Framework?

I am trying to customize an Entity Framework model associated with a bunch of views. When I add a view, he wants to make most of the fields in the Entity Key for no apparent reason.

Even worse, when I try to create a relationship between these two views, I get an error message indicating that I should specify a mapping for all key properties ... although I changed all of them so that I would no longer be Entity keys. I think that the basic table model still marked them as keys, but I cannot change it in the .store object in the designer.

So,

1) How to prevent the use of EF for each field as a primary key?
2) How to remove EntityKey = true value from .store object?
3) Why is it so complicated?

EDIT: Alright, got it No. 1. I had to manually edit the xml and remove the keys from the SSDL, as well as the CSDL section ...

Now, if someone can answer 2 and 3, I could get somewhere!;)

+3
source share
1 answer

Please note that in the final version of Visual Studio 2010, the developer automatically synchronizes the key definition with the entity with the key definition of the view - this means that you do not need to go and edit the SSDL.

0
source

Source: https://habr.com/ru/post/1709627/


All Articles