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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:22:35+00:00 2026-05-13T06:22:35+00:00

I am looking into migrate a large project to Entity Framework 4.0 but am

  • 0

I am looking into migrate a large project to Entity Framework 4.0 but am not sure if it can handle my inheritance scenario.

I have several projects that inherit from an object in the “main” project. Here is a sample base class:

 namespace People
{
    public class Person
    {
        public int age { get; set; }
        public String firstName { get; set; }
        public String lastName { get; set; }

    }
}

and one of the sub-classes:

namespace People.LawEnforcement
{
    public class PoliceOfficer : People.Person
    {
        public string badgeNumber { get; set; }
        public string precinct { get; set; }
    }
}

And this is what the project layout looks like:

People – People.Education – People.LawEnforcement http://img51.imageshack.us/img51/7293/efdemo.png

Some customers of the application will use classes from the People.LawEnforcement and other users will use People.Education and some will use both. I only ship the assembles that the users will need. So the Assembles act somewhat like plug-ins in that they add features to the core app.

Is there anyway in Entity Framework to support this scenario?

Based on this SO question I’m think something like this might work:

ctx.MetadataWorkspace.LoadFromAssembly(typeof(PoliceOfficer).Assembly);

But even if that works then it seams as if my EDMX file will need to know about all the projects. I would rather have each project contain the metadata for the classes in that project but I’m not sure if that is possible.

If this isn’t possible with entity framework is there another solution (NHibernate, Active Record, etc.) that would work?

  • 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-13T06:22:35+00:00Added an answer on May 13, 2026 at 6:22 am

    Yes this is possible, using the LoadFromAssembly(..) method you’ve already found.

    … but it will only work if you have an specialized model (i.e. EDMX) for each distinct type of client application.

    This is because EF (and most other ORMs) require a class for each entity in the model, so if some clients don’t know about some classes, you will need a model without the corresponding entities — i.e. a customized EDMX for each scenario.

    To make it easier to create a new model for each client application, if I was you I’d use Code-Only following the best practices laid out on my blog, to make it easy to grab only the fragments of the model you need actually need.

    Hope this helps

    Alex

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

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I hate to say something so unimaginative, but MVC works--it's… May 13, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer Sounds like what you want to do is something like:… May 13, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer public class Item { public string Name; public Item Parent;… May 13, 2026 at 7:01 pm

Related Questions

We have Exchange integration into our CRM (diaries and email); we have done this
Ok I followed the steps for setting up ruby and rails on my Vista
I just migrated to Windows Ultimate 64 SP1, because my system's hard drive crashed.
I am looking into game programming in Java to see if it is feasible.
I am looking into internationalizing a Flex application I am working on and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.