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 uses Entity Framework 4.1 with database first approach. I have in database a
The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
Application use NHibernate. I Have object A that contains set of objects B. I
Application db connection in web service. i haveto connect the db using that web
My application is suspending on a line of code that appears to have nothing
Application configuration: Web application using java first method of creating JAX-WS 2.0 Web Services
Application is asp.net MVC. I want to put a textbox for date using mask.
Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Application I work on generates several hundreds of files (csv) in a 15 minutes
My application is completely navigation based and my query is that navigation based application

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.