-
Notifications
You must be signed in to change notification settings - Fork 60
Enhancement: Default Default Constructor Visibility #43
Comments
Unfortunately, that's pretty much an edge condition that I don't think should be implemented in the main project. The reason the tool decides the default visibility of the default constructor the way it does is due to required properties, both scalar values and associations. It would be all too easy to allow an override that would then allow an invalid object to attempt to be saved, which would blow up at runtime. This is a perfect case for the ability to modify the generated code by editing the T4. You clearly have a good grasp on how the template works, and I'd suggest that you just override the generation the way you need it done. That will give you the ability to use the POCO objects for ODATA while at the same time giving design safety for the masses. |
I was trying to stay in sync with your updates on the .tt's if possible. Even if it could be moved into the model without exposing it in the UI, that would help. I would just set it in the first .tt and all the others would be as-is. |
If I did a pull request, would you be inclined to consider it? I might decide to branch it anyway, but that is a significant effort for the return. If not, I COMPLETELY understand. Thanks. |
Certainly! Always welcome pull requests. |
I am in the middle of a big project right now, but i AM planning on doing a pull request. I will address this issue as well as another that I am going to enter shortly. Thanks for a great project. |
Closing due to age. Looking forward to the PR! |
The title is not a typo. I would like a new setting in the designer for Entity Model settings that will set the default visibility for the default constructor for all entities in the model. OData requires a public default constructor for POST operations. The second half of the feature would be in the code generation side where you could have something like:
Thanks for such an awesome effort and product.
The text was updated successfully, but these errors were encountered: