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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:07:49+00:00 2026-05-28T11:07:49+00:00

I’m doing some simple things with EF4 and inheritance before I start the real

  • 0

I’m doing some simple things with EF4 and inheritance before I start the real work. I have tried it many ways and I can’t fix this.

I have two tables:

  • reporting_Items (ItemId,etc)
  • reporting_DataItems (ItemId,etc)

I need to keep the prefixes in the database tables because of coding convention.

Then I want to have the maped entities with the names Item and DataItem, and DataItem inherits from Items.

I did Database First and created the tables, but I removed the ItemId key from reporting_DataItems.

Then I generated the model from the database. It created the entities:

  • reporting_Item
  • reporting_DataItems

which I renamed to Item and DataItem respectively. Then I created the inheritance relation between DataItem and Item.

So up to this point I have the entities named like I want and the tables named like I want, plus the inheritance.
The problem is that if now I run Generate Database from Model it deletes all the tables and creates them with this names:

  • Items
  • Items_DataItem

Is there any way to acchieve what I want to do? Thanks in advance

  • 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-28T11:07:50+00:00Added an answer on May 28, 2026 at 11:07 am

    You can use either database first (generated model from database or model first (generate database from model). Combining them is not supported because when you use model first it doesn’t use information about your original database. It uses its own conventions to name tables and it expects that you are going to use that new table names instead of old ones. Conventions can be changed but it means changing .tt template used to generate SQL.

    So if you have existing database and you want to use it, never use Generate Database from model because this tool is not for your scenario.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.