none
“Object mapping could not be found for Type with identity” Exception RRS feed

  • Question

  • 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 I understand EF looks for Vendor in the calling assembly and can not find it there. It should be the way of telling the context where to search types, but I have no idea which one.

     

    Thursday, October 13, 2011 6:58 AM

All replies