Not mapped issue
saigkill opened this issue · 1 comments
I have the following case: I have a BaseEntity where all other Entity derive from. Inside that i have some standard things defined, like ID, Created and Modified. Currently i solved that case by adding a custom atribute "NotMapped" to the BaseEntity class. After gerneration was the BaseEntity in DBSet and modelBuilder from the context. Can this be fixed?
This is one that I've had on my plate for some time now.
I've added a "Persistent" property (defaults to true) to the class. Setting it to "false" will, after validating that it's allowed to become a transient class, cause code generation to do the things you're looking for.
Paying attention to the attributes becomes a slippery slope, since there's an uncountable number of possibilities, so supporting this with its own property helps limit that and allows the modeler to provide some assistance to folks who might try adding a transient class in the middle of an inheritance hierarchy (the tool prevents that since it causes all sorts of chaos).
Thanks for the report! It'll be in 4.2.