Default constructor for Domain Entities to be protected
When generating Domain Entities from the Intent.Entities module, there is a default constructor that is generated as well since EF needs a default constructor when loading information from the DB.
However, there are two concerns at play here.
- If we want to go with the DDD approach and install the DDD Module, then we need to mark the default constructor as
protected(EF can actually still use aprotectedconstructor) so that the developer is forced to create a constructor (since the protected one is off limits to the dev) that will populate the Domain Entity via the constructor and not through the property specifiers and EF is still able to load up an entity using the default constructor. - If the developer doesn't want to go with the DDD approach, we should either let it create a normal
publicconstructor or not generate a constructor at all (depends what makes the most sense).
Currently we have a decorator to create the default public constructor:

How can we have a more "intelligent" behavior that would check to see that the DDD module is installed, therefor make the constructor protected and if not, make it public?
Based on the previous discussion, we will look at having DDD having its own Entity templates for generating Domain Entities which can then have the protected constructor and then the explicit constructor for Developers.