EF6-CodeFirst: How to have a different target folder for the code in persistent & model project

Posts   
 
    
pat
User
Posts: 215
Joined: 02-Mar-2006
# Posted on: 25-Apr-2017 18:07:08   

In EF6 Code First the files are placed in a specific location inside the persistent & model projects

..\Northwind\Persistence\NorthwindModelBuilder.cs

namespace Northwind.Tutorial
{
    /// <summary>Class which represents the DataContext for the project / group 'Northwind'</summary>
    public partial class NorthwindDataContext : DbContext

..Northwind\Model\EntityClasses

namespace Northwind.Tutorial.EntityClasses
{
    /// <summary>Class which represents the entity 'Category'.</summary>
    [Serializable]
    [DataContract(IsReference=true)]
    public partial class Category : CommonEntityBase

How could I change it please so that I end up with:

  • \Northwind\Northwind.Model\Model\EntityClasses\
  • \Northwind\Northwind.DAL\DAL\NorthwindModelBuilder.cs Thanks, Patrick

PS: Link to a very related ticket about namespaces per project: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=24262

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 25-Apr-2017 22:02:49   

Please follow up the answer in the thread you have referenced. But instead of the additionalRootNamespace attribute, use and set the additionalDestinationFolder attribute.

pat
User
Posts: 215
Joined: 02-Mar-2006
# Posted on: 26-Apr-2017 18:58:33   

Great thank you