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 3271712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:45:17+00:00 2026-05-17T18:45:17+00:00

My Question is can we extend one context to another in Entity Framework 4.

  • 0

My Question is can we extend one context to another in Entity Framework 4. Following is the problem background.

I am using EF4 for developing a Web-Application. My Web Application has 3 projects.

  • One project is for storing candidate CV information.
  • Another project is for storing customer information.
  • Final project is called CORE. this CORE contains a edmx file that should be extended by CV and CRM.

As an example email address table can be shared by both customer (CRM) and CV. To share one table with another, we should be able to extend one context (CV context) with other context (customer context). Could some one having experience using Entity Framework share your experience with me to find whether this is possible.

We have 3 edmx files in three class libraries:

  1. Person class library(Core) with core.edmx-Basic details related to a person(name, email)
  2. CV Class library with CV.edmx wich have CV related data(Experiance,skills)
  3. Customer Relationship management system(CRM) which have customer data(sales data…)

Then we want to use core class library edmx file(Core.edmx) with cv.edmx (basically cv tables should be able to use tables from core tables) .
Same way we want to use the core.edmx with CRM.edmx for the 3 rd project

  • 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-17T18:45:18+00:00Added an answer on May 17, 2026 at 6:45 pm

    Well first of all, your EDMX’s shouldn’t (actually can’t) talk to each other.

    It’s usually a 1-1 between Context -> EDMX -> Database.

    A better solution would be encapsulate your Model’s behind a Repository.

    One Repository per aggregate root will give you a PersonRepository, CvRepository, CustomerRepository.

    Each DLL can expose a single Repository.

    Then, you would need a “Service Layer”, which can work with the repositories. Similar to a “Unit of Work”.

    E.g you might create a CvPersonService, which could handle interactions with both the Person (Core) and CV Repositories:

    using PersonRepository;
    using CvRepository;
    
    public class CvPersonService
    {
       public CvPerson GetHydratedCvPersonFromTwoRepositories()
       {
            var person = personRepository.Find(1); // get a person
            var cv = cvRepository.Find(1); // get a cv
    
            return new CvPerson { ThePerson = person, TheCv = cv };
       }
    }
    

    The important thing to note is, EF makes no assumptions about database connections and the context. A database associated with a particular context could be on a local machine, a development server, or on the cloud. EF doesn’t know (or care) about WHERE the database is. The SQLProvider in your configuration specific this. EF must assume it could be anywhere.

    Therefore, you can’t really “JOIN” queries from one context to another. How would this work? Maybe in “old-school”, you could use a linked server, but it’s not feasible for an ORM like this.

    Put it this way:

    1. Create a database hosted on your local PC (DB1)
    2. Create a database hosted on the internet. (DB2)
    3. Write a query to join results from two tables, one from DB1, one from DB2.

    You can’t do it can you? Neither can Entity Framework. 🙂

    Even if all three EDMX/Context’s used the same database, it wouldn’t matter.

    The above would be a better solution – rearchitect it in a way which you can gracefully expose the models via fluent Repositories.

    HTH

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

Sidebar

Related Questions

No related questions found

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.