EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
Making DDD Style Entities
I am trying to make my output more in line with DDD guidelines, and I could use a little help on how to achieve some items.
What I have done:
- Set Settings.UsePropertyInitialisers to true, so I can create my own constructors.
What I want to achieve:
- Remove all navigation properties from child entities to prevent accessing parents from children.
- Use a backing list on child ICollections so we can make the child collections readonly. We will add methods to add/remove items to the child collection in the partial class file.
- If one does not already exist, auto-generate the base partial class with a protected parameterless constructor (required for EF), so I can then just add the required parameterised constructor. We have hundreds of tables in our database, so every little thing that can be automated helps. ;)
As a suggestion for the future, could we create a set of templates that more closely follow the DDD principals?
Any assistance anyone could offer on these items would be greatly appreciated.