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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:46:02+00:00 2026-06-12T04:46:02+00:00

I have a large MVVM-type solution which I originally wrote using VS2010 Express with

  • 0

I have a large MVVM-type solution which I originally wrote using VS2010 Express with .NET4. The Model uses Entities to access a SQL Server 2012 database.

I managed to lose the Model project recently, which didn’t seem a big deal, as it really consists of the Auto-generated Entities with a few minor modifications. I have therefore recreated the model project using VS2012 with .NET4.5 and EF5. I have upgraded the ViewModel to .NET4.5 and have imported EntityFramework using the package manager.

The problem is, my ViewModel (a separate Class Library) throws several compile-time errors which I cannot figure out. These revolve around:

  1. The main Entities class (in my case, CN2Entities) no longer has a constuctor which takes a connection string. This is confirmed by autocomplete, which only offers a parameterless constructor.
  2. The individual database object classes which map to database tables, such as “Addresses” no longer contain their static members. For example:

    address_ = Address.CreateAddress(-1);

This code used to provide me with a nice, empty address record to fill and add to the database. This is no longer valid. In fact, the only static members of the Address class appear to be “Equals” and “ReferenceEquals”.

  1. The main Entities class no longer contains the AddToAddress(Address) function, which would then take the new Address object (representing a row of the Addresses table) and add it to the database. I would then call Entities.SaveChanges() to commit the addition. This function still seems to be present.

Can anyone please help me with what is going on? Is this something to do with the new way EF5 works or do I have a corrupted solution which is not providing me with the correct references?

  • 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-12T04:46:03+00:00Added an answer on June 12, 2026 at 4:46 am

    Whey you recreated the model project you have used Entity Framework 5 with completely different API (and different auto-generating strategy). There are two APIs for EF since EF 4.1 but in VS 2010 second API (DbContext API) was optional and available only after referencing separate assembly. In VS 2012 DbContext API is supposed as default when you add EDMX (VS downloads that additional assembly from NuGet).

    You can still use old API – expand EDMX file in solution explorer and delete all files with .tt extension. After that open EDMX diagram and in properties change Code Generation Strategy from None to Default and save the diagram. It should generate classes for the old API but I don’t know if the code generator is the same as it used to be in VS 2010.

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

Sidebar

Related Questions

I have large WPF-MVVM application in which I have 1 subscribe and 2 publish
The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
I'm using the MVVM pattern in my first WPF app and have a problem
I am unsure how to structure a large program using PRISM Modules. I have
I have large amount of data to be plotted on iPad using a core
i have large data in label field and using FOCUSABLE on it makes the
I have a reasonably large application in C#/WPF made with MVVM (sort of). In
We have large C# application spanning many projects which is packaged into an .MSI
I have large text containers and i want to compare and highlight them using
I have a large existing project in Silverlight which has many user controls with

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.