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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:37:30+00:00 2026-05-25T11:37:30+00:00

In my application I’m using Entity Framework 4.0 Model First. I have several tables

  • 0

In my application I’m using Entity Framework 4.0 Model First.
I have several tables that implement inheritance, like Product as a basetable and SpecificProduct that inherits from Product.

The inheritance is visible in the edmx file. To initially set up the database, I rightclick on the designer and select “Generate Database from Model”, which generates an SQL create script.

Let’s assume I do some changes in the SQL database to the SpecificProduct table and want to upgrade the model. Obviously I’d delete the table SpecificProduct from my edmx file and I’d rightclick on the edmx designer and select “Update Model from Database”.
This results in the inheritance between Product and SpecificProduct being lost. Instead of the inheritance I do have a 1 to 0..1 relationship and the primary key of Product is now also a column of SpecificProduct.
This is actually not the way I want it to be, because my project won’t build anymore, because my code relies on the inheritance being available.

I can manually fix this in the designer file by deleting the inserted primary key column into SpecificProduct, deleting the new 1 to 0..1 relationship, and inserting the inheritance in the edmx designer, again.
Ain’t there a way to do this automatically?

Or is this simply a limition of the Model First attempt, that I wasn’t aware of (and wouldn’t choose again, if this really is a limitation)?

  • 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-25T11:37:31+00:00Added an answer on May 25, 2026 at 11:37 am

    You must not manually delete anything from EDMX file. Once you delete it your mapping is lost. The inheritance must be always mapped manually because database layer has no knowledge about it. You always start with basic relations which you must delete and change it to inheritance.

    So in your case try to simply run update from database without deleting your entity. The new column should be added as a property to your entity. Btw. there is no swapping between model first and database first. Use the first approach or second approach. Combining them is not supported.

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

Sidebar

Related Questions

Application deals with strings that represent decimals that come from different cultures. For example
Application is a C# .Net 3.5 WCF Service. I'd like during the build process
Application : It has 3 views Views A,B,C. There is a Alert on View
APPLICATION : My application has three pages Page A,Page B and Page C. WHAT
Application flow An input file consists of multiple logical documents. Extract one input logical
application for project .....csproj is not installed. Make sure the application for the project
APPLICATION DESCRIPTION : I am a new iPhone developer. I am working on an
Application.Run(new Main()); This line gives TypeInitializationException was unhandled after I switched from 3.5 to
Application failed codesign verification. The signature was invalid, or it was not signed with
Application is to display device distance to GPS coordinate on screen of mobile device

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.