As a part of our application architecture, we like to define clear lines between our functional layers. A typical application solution, therefore, will contain:
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.