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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:13:52+00:00 2026-05-23T05:13:52+00:00

As a part of our application architecture, we like to define clear lines between

  • 0

As a part of our application architecture, we like to define clear lines between our functional layers. A typical application solution, therefore, will contain:

  • Entity
  • Model
  • Task
  • Presenter
  • FrontEnd

These end up being completely distinct assemblies.

The Entity/Model delineation is done to keep database access functionality in a separate layer from our POCOs, so that only Task ever need know about Model, while everyone up to Presenter knows about Entity

This works well when using Code-First or Fluent-API – but due to the lack of support for SPROCs in those paradigms, it turns out that under EF 4.1 I must use EDMX models.

So – I’m generating POCOs using a DbContext Generator, but the resulting classes end up under .Model, and while I can force their namespace into .Entity instead, they still live in the .Model assembly, which means now .Presenter must reference .Model to get to classes that should be in .Entity.

Is there a way to force or trick EF to dump its generated output into a different Project?

  • 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-23T05:13:53+00:00Added an answer on May 23, 2026 at 5:13 am

    Sure. DbContext Generator are just two T4 templates. You can move the template generating entities to other project. You just need to modify template to point to correct EDMX file. This is default:

    string inputFile = @"Model.edmx";
    

    You must change it to relative address to your EDMX file. It will be something like:

    string inputFile = @"../Model/Model.edmx"
    

    The template will automatically use default namespace of current project for generated entities but you will have to modify the second template for context to use the new namespace so that entity types are correctly resolved from referenced assembly.

    There is small disadvantage of using template in another project – it will not update automatically when you modify model. You must always trigger entity recreation manually by using Run custom tool from context menu on template file.

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

Sidebar

Related Questions

as part of our application i need to build component that will output code
As a part of our application I need to write simple workflow system which
We’re currently in the process of updating the email dispatch part of our application
Part of our java application needs to run javascript that is written by non-developers.
As part of our web application's build process, I have set up our XSLT
I have for the most part successfully embedded firefox/xulrunner into our c# application, but
We are using Mage.exe to generate our application's manifests as part of our build
Our application runs succesfully on Tomcat, Websphere and Weblogic and as part of it
As part of getting our application ready for Windows7, we recently added a manifest
In our application, we have certain scenarios where we'd like to perform a redirect

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.