-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parameterless constructor #103
Comments
I think it was removed because the class is abstract, so you would never create it directly anyway. Any child type you create can have its own parameterless constructor in order to support EF/EF Core. I see you're doing that - is the issue just that you have to pass so much code into it or what? |
It is fine that the child type add its own parameterless constructor. I think that it is unnecessary noise for the programmers, two empty strings won't pass the compiler, so, I feel that it is more clear and clean for the child type if SmartEnum's abstract class provide the parameterless constructor. Thank you for you reply. By the way, I learn my DDD concept form you course. It helps me a lot. Thank you. :) |
Is this still an issue and if so how would you recommend implementing a constructor in the base abstract class? Should it just do nothing and leave its name and value fields uninitialized? |
#16 works fine I believed, It require less noise code in the child type when people need to use EF Core. Yet, it is fine that if you decide not to add it back. Feel feel to close this issue. |
Commit #16's parameterless constructor is not in the source code anymore. Is there a reason for this?
In order to put the smartEnum into a EF Core Table, now I need to do the following for the constructor
EF Core Value Conversions does not work for me, because I do want to save both name and value into the database, so user can add record to it later as well.
related issues
#16
#15
The text was updated successfully, but these errors were encountered: