I'm trying to get a record using GetObjectByKey function like this:
Enumerable<KeyValuePair<string, object>> entityKeyValues =
new KeyValuePair<string, object>[] {
new KeyValuePair<string, object>("JournalId",
new Guid("6491305f-91d9-4002-8c47-8ad1a870cb11")) };
EntityKey key = new System.Data.EntityKey(string.Format("{0}.{1}", ObjectContextManager.Current.DefaultContainerName, "Journal"), entityKeyValues);
But i get this exception
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.
Thanks in advance