-
Notifications
You must be signed in to change notification settings - Fork 37
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
EF Core Support Extension #1 #512
Comments
Hi - thanks for the suggestions. For this, I think it would have to be a separate NuGet package as the code that Vogen generates is only additive; everything EF core related generated by Vogen is specific to a particular type. Also, Vogen doesn't directly need a dependency on EF Core, so if we were to add this to But there certainly seems enough appetite for more EF Core support, so maybe a new |
Vogen is already using EF Core if |
Unfortunately not. The source generator is only additive, so it can only extend the type decorated with the Actually, while I was writing this, I think I figured out what you meant. For each class it generates, it would also generate a static method for the extension, e.g. for a Value Object of type
If that's the case, then it should be trivial to add. I guess it's not a breaking change for anybody? |
@SteveDunn it should not be a breaking change, since we are adding an extension method that needs an opt-in to use |
I've added this. It's wrapped in a static class that has the same accessibility as the containing class. It is It's building now, so I'll do a pre-release nuget package soon. |
feat: implement #513 EF Core add `EfCoreValueComparer'
This is now implemented in 3.0.23. Thanks for you support! |
Just a comment, not sure if worth opening a new issue. The above code works for a specific property, but usually when you register a converter/comparer, you do for any properties of a specific type (at least that's what I do). Without changing anything, you could simply add another extension method, that reads like: public static PropertiesConfigurationBuilder<CityId> HasVogenConversion(this PropertiesConfigurationBuilder<CityId> propertyBuilder) =>
propertyBuilder.HaveConversion<CityId.EfCoreValueConverter, CityId.EfCoreValueComparer>(); And with that you have covered both cases: registering a single property, or registering any property of the given VO type. |
Create a built-in EF Core extension class for providing the correct
HasConversion
overload.The text was updated successfully, but these errors were encountered: