with the Tutorial: http://www.asp.net/mvc/tutorials/mvc-5/database-first-development/creating-the-web-application I created a Entitiy-Framework Version 6 File (.edmx), with the sub-files. This File is in my project: SimpleSalesOrder.DataLayer.SQL.
Everything fine so far, but I'd like to generate the Business-Model Classes in our SimpleSalesOrder.BusinessModel.SQL Project to seperate the DataLayer from the BusinessModels.
I'm quite sure I have to edit the T4-Template to make this work. The Namespace itself is no problem since I can enter this when I create the EF-Contect.
I found the Point, where the Files get created:
foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
{
fileManager.StartNewFile(entity.Name + ".cs");
BeginNamespace(code);
#>
But as you cann see, It passes only the Class-Name. The Output itself is setted in the Process Procedure:
var outputPath = Path.GetDirectoryName(_textTransformation.Host.TemplateFile);
So there is no Problem to kindahow set this Name to the Name of the BusinessModel. But is this the way to do it? Is there a easier way to make this work? I could imagine many people would like to seperate the BusinessModels from the DataLayer.
Thanks in advance and a good night!
Matthias