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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:25:02+00:00 2026-06-15T08:25:02+00:00

I have 3 tables in my MS SQL database and I have added a

  • 0

I have 3 tables in my MS SQL database and I have added a EntityFramework(latest) to my project where I have imported these 3 tables. The first problem was that no Entities was built so I changed “Code Genereation Strategy” from None to Default.

After build I get

X Already Contains a definition for Y

on all properties of the entities.

When looking closer it have generated a partial ex Users.cs and one partial User in in the MainModel.Designer.cs?

Why is it generating User.cs? I have a similar setup in another project and the EF is set with the same settings, there is no User.cs?

Edit1 : I can see one thing that differs and thats Use Strong Spatial Types that is set to False in the failing project, it is however not possible to set it to true(grayed)?

  • 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-15T08:25:03+00:00Added an answer on June 15, 2026 at 8:25 am

    You should either use None code generation strategy for your .edmx file. Or remove MainModel.tt and MainModel.Context.tt templates, which generate model entities and context.

    If you use Default code generation strategy, then entities and context will be generated into MainModel.Designer.cs file. That would be standard entities, inherited from EntityObject, context will be inherited of ObjectContext. With Entity Framework 5 we have POCO entities generation. And whole generation is done in T4 templates, which generate context, inherited from DbContext, and POCO entities without some base type (well, object only).

    When you have both templates and enabled code generation in edmx designer, then two sets of entities will be generated. That’s why you have names conflict.

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

Sidebar

Related Questions

i have 3 Tables is my SQL Database: First Table: Room: ID <pk>, Roomname
I have an SQL database with a set of tables that have Unique Id's.
Anyone have a PL-SQL statement that i can use to generate database & tables
I have an SSIS package that takes data from Tables in an SQL database
I have two tables Team_DATA and Driver_PROFILE_DATA in an SQL database. For every driver_profile
We have two tables in a SQL Server 2005 database, A and B.There is
I am using Sql database and I have indexed some tables. In some tables
I am working on PHP and database MySQL. I have two tables in SQL
SQL Server 2008 Database Question. I have 2 tables, for arguments sake called Customers
I have database with multiple tables in Microsoft SQL Server with schema in tables

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.