-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
SmartEnum.EFCore + SmartEnum.EFCore.UnitTests #53
Conversation
The additional package makes it possible to configure all SmartEnums for Entity Framework Core with one single line of code.
…y unit test project
This is very cool! My only suggestion is that you update the README to include your sample code and how to install the package. Assuming that this would be it's own package (which it should be) |
This looks great there's only one thing I'd change before merging which is pretty simple. Can we not put SqlLite and Migrations and EF into the UnitTests project, since these all are external dependencies, and instead create a new IntegrationTests project side-by-side with UnitTests and move those tests and their dependencies there? Thanks! |
@mjuen do you have time to make the updates I asked for? |
Ok, can someone help get this over the finish line? |
Sorry, I'm busy at the moment, but feel free to adjust everything to your needs. |
Just got stuck on an issue that this PR fixes, its a shame 18 months later its not done yet... |
does SmartEnum.EFCore make it into release? Couldn't find it in Nuget. |
Someone could please resolve conflicts and update this to use the current code, and we could merge it in. Otherwise in a month or two I will close this. |
sorry for the mess regarding closing/reopening pull requests, I got a little confused about how to submit a pull request to another pull request. @ardalis, could you please take a look at #142 and tell if this is what you had in mind re #53 (comment)? |
* Added SmartEnum.EFCore + SmartEnum.EFCore.UnitTests The additional package makes it possible to configure all SmartEnums for Entity Framework Core with one single line of code. * Changed folder names to match existing folder structure, deleted empty unit test project * Updated README to include information about SmartEnum.EFCore * implementing suggestions from #53 (comment) Co-authored-by: Marcel Juen <marcel.juen@raincoat.systems> Co-authored-by: Steve Smith <steve@kentsmiths.com>
Let’s face it. Configuring a huge amount of properties with special requirements in Entity Framework Core is time consuming, sometimes error prone, and in general annoying. If you want to use SmartEnum in this environment, you have to deal exactly with above-mentioned problems every time you are using the enum in an entity. This PR aims to eliminate the hassle and provide a convenient way for configuring all SmartEnums at once with one single line of code. It adds the new project
SmartEnum.EFCore
together withSmartEnum.EFCore.UnitTests
.Just use
at the end of the
OnModelCreating
method and you are good to go.Take a look at it and tell me what you think :)