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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:40:59+00:00 2026-05-23T17:40:59+00:00

I have generated entity model from my database which created entity classes. 1) Is

  • 0

I have generated entity model from my database which created entity classes.

1) Is there a way that it creates separate file for each class?
2) Can we move these classes to a different assembly? For example how can I move these classes to a different project in my solution?

I want to separate the entity model from classes and use the classes in Presentation Layer.

  • 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-23T17:40:59+00:00Added an answer on May 23, 2026 at 5:40 pm

    You can of course create the edmx in a separate project but I don’t think you can separate the classes into more than the generated default files. Note that you shouldn’t attempt to edit the generated classes as these will be overwritten when updated and you can easily break stuff too.

    You can, however, create a public partial class with the same namespace and class declaration as each of the Entity objects to allow you to extend the classes and add initialization / validation functions etc. allowing you to put each entity in its own class file for extending.

    Updated:

    All related partial classes must be in the same assembly and need to use the same namespace and class declaration as the original entity partial class in the <EntityModel>.Designer.cs. See below for example code.

    namespace YourEntityNamespace
    {
        public partial class YourEntity : EntityObject
        {
            // Add methods and properties to extend the entity class
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My entity model was generated from the existing database. There is a many-to-many junction
I created a new Entity Framework model from a database. This database has a
I have a generated txt file. This file has certain lines that are superfluous,
I have an automatically generated XML file for the game that I run. It
I have a core file generated on a remote system that I don't have
I have a page that is generated which inserts an HTML comment near the
I have got an Entity model which contains a collection of Message objects which
Using Microsoft's designer for the Entity Framework (v3.5), I have created an Entity Model
I have an established SQL Server database setup. I then generated an Entity Framework
when i 'generate database from model' in an edmx file it asks for a

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.