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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:28:42+00:00 2026-05-29T06:28:42+00:00

I am searching for the solution of the problem i am and probably many

  • 0

I am searching for the solution of the problem i am and probably many must be facing.

Curently i am working on a application containing nearly 400 tables.
Application consists of seven Class library projects( StudentInfo, library, Fees etc) and each has its own .edmx file(consisting 50 tables) with code generation strategy=default And
a single web application project which references the class library projects.

There are around 15 tables which are common and will be present in .edmx file in each class library project. The namespace of the classes/models is the same(Campus) in all the .edmx files.

I have created a partial class namely School(which is one of the commom table/model) which contains some methods.

However the following compile time error is thrown
The type ‘Campus.School’ exists in both ‘D:\Project\Campus\CampusStudent\’ and ‘D:\Project\Campus\CampusLibrary\bin\Debug\CampusLibrary.dll’

The solutions that were suggested by other members
1)Have separate namespaces for each of the .edmx files.
2)Use different names to the models namely StudentSchool, LibrarySchool etc.
Both solutions will force me to duplicate the common classes with its methods in each of the class library projects.
Can anybody help me?

  • 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-29T06:28:43+00:00Added an answer on May 29, 2026 at 6:28 am

    There can be a way if you are using POCO T4 template for current entity generation. POCOs in EF can be any class in any namespace which have the same name as entity in your EDMX and which have all properties with the same name as entity in EDMX (including same types and accessibilities for getters and setters).

    Define your 15 shared classes in another assembly (you must follow those mentioned POCO rules) and reference it by all library projects. Once you have this assembly create your own version of POCO T4 template which will not create new class files for those shared entities and instead use classes from referenced assembly.

    The other option is manual creation and maintenance of all those 400 classes and EF context types. That is what you will do if you use code only mapping (aka code-first) and you will not have these problems.

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

Sidebar

Related Questions

I've been searching through forums to find a solution for the problem I'm facing
Hi I have been searching a solution to this problem for many days but
Hey i was searching for a solution for my problem and i nearly have
I am searching for a solution for my problem for days and I have
I've spent a few days searching a for solution to my problem. I'm having
There is probably a very easy solution for this problem. I could easily do
I've been searching for a solution for this problem but I couldn't solve it!
I found similar questions while searching for a solution for my problem but I
I've been searching for a solution to my problem for a long time now
So I have been searching everywhere for a solution to this problem. I have

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.