Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:07:48+00:00 2026-05-26T12:07:48+00:00

I use EF 4.1 with POCO. Entities with edmx are located in a separate

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:07:48+00:00Added an answer on May 26, 2026 at 12:07 pm
    ctx.MetadataWorkspace.LoadFromAssembly(assembly);
    

    before TryGetObjectByKey works fine.

    ‘aseembly’ is the assembly where model classes live.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im planning to use the Entities generated by the EF (POCO) in sending data
I am not a big fan of datasets so I use POCO to return
I have converted an Entity framework project to use POCO objects by removing the
One advantage that comes to my mind is, if you use Poco classes for
I use MyGeneration along with nHibernate to create the basic POCO objects and XML
I have several entities generated from my Entity Framework data model. In the .edmx
I'm trying to work through a problem where I'm mapping EF Entities to POCO
I use EF for Visual Studio 2008, so I don't have POCO integration with
The use of proxies with EF 4.1 POCO is clear and straightfoward. But why
I`m thinking of using POCO instead of automatically generating the entities, cause i don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.