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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:48:58+00:00 2026-06-10T11:48:58+00:00

I’m using EF CodeFirst to generate quite a large schema including TPT tables, e.g.

  • 0

I’m using EF CodeFirst to generate quite a large schema including TPT tables, e.g.

[Table("MissingReplacementDongles")]
public class MissingReplacementDongle : ReplacementRentalDongle
{
    public virtual bool OriginalStolen { get; set; }
}

public abstract class ReplacementRentalDongle : ConsequentialRentalDongle
{
    public virtual Money ReplacementCharged { get; set; }
}

[Table("ConsequentialRentalDongles")]
public abstract class ConsequentialRentalDongle : RentalDongle
{
}

[Table("RentalDongles")]
public abstract class RentalDongle : BaseConstraint
{
    public virtual DateTime CurrentExpirationDate { get; set; }

    public virtual DateTime? ReturnedDate { get; set; }
}

I’ve been developing against a SQL Server Express 2008 installation, and this generates the tables perfectly, i.e a ReplacementRentalDongles table with a ReplacementCharged_Id column, which references a Money table.

However, when I run the same code, but using a SQL Server 2008R2 Developer instance, the tables generated are different! In this case, the ReplacementCharged_Id column ends up being generated in the ‘base’ table BaseConstraint.

Is this a bug in EF 4.3.1, in that a different SQL Server version ends up creating a different Schema? Is EF compatible with SQL 2008R2 ?

  • 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-06-10T11:48:59+00:00Added an answer on June 10, 2026 at 11:48 am

    Just to let you all know that I managed to fix the problem – by simply upgrading to Entity Framework 5.0 (released just two weeks ago – http://blogs.msdn.com/b/adonet/archive/2012/08/15/ef5-released.aspx )

    EF 5.0 has implemented new features which are available if running on .NET 4.5 (which we’re not, we’re on .NET 4.0). However, EF 5 does run on .NET 4 also, it would also effectively seem to be a roll-up of bug-fixes for EF 4.3.1 when running on .NET 4.

    Short version – upgraded the EF DLLs to 5.0 (via NuGet), and the same (correct!) schema is now generated for new databases on SQL 2008 Express AND 2008R2, it works great!

    One small caveat – I had to update my source with extra using directives, as the [Table], [InverseProperty] etc attributes have been moved into the System.ComponentModel.DataAnnotations.Schema namespace (they were in the System.ComponentModel.DataAnnotations namespace in EF 4.3.1)

    Simple solution – just upgrade!

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.