I use EF 4.1 with POCO.
Entities with edmx are located in a separate assembly.
When I call:
var key = new EntityKey("MyEntities.Vendors", "Id", vendorId);
if (ctx.TryGetObjectByKey(key, out vendor)) ...
Exception is thrown “Object mapping could not be found for Type with identity”
As far as I understand EF looks for Vendor in the calling assembly and can not find it there.
So it should be the way of telling the context where to search types, but I have no idea which one.
before TryGetObjectByKey works fine.
‘aseembly’ is the assembly where model classes live.