System.ArgumentException: The provided list of key-value pairs
contains an incorrect number of entries. There are 54 key fields
defined on type 'Namespace.Journal', but 1 were provided. Parameter
name: key

The type Journal is a view.

How can i do to use that function with just one field, the reason why i need that is because i don't want to specify a generic type , just one to get it from the given entity set name.

1 Answer
1

View in database doesn't have a key but EF needs it so when you insert the view to the model EF will take all non-nullable, non-binary columns and defines them as a key - at the moment your key consists of 54 columns. The solution is manually modifying EDMX file (as XML) but with default EDMX designer your changes will be deleted after each update from database.