-
Notifications
You must be signed in to change notification settings - Fork 229
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
Switch to JSON.NET #1940
Comments
One main reason why JSON.NET wasn't implemented, was that we don't want to add a reference to JSON.NET from EFCore.PG itself - that would force it upon users and potentially created dependency hell situations (System.Text.Json has the advantage of being built into the framework). EF Core does have a plugin model which allows having external nugets which add the reference, but the JSON support requires certain advanced functionality which isn't possible from a plugin. Then there's the burden of maintaining two JSON implementations rather than just one... System.Text.Json has generally been improving and closing the gap, so this doesn't really seem like a good way forward. |
@roji I guess there is no easy way to override it globally. Or be able to create a custom attribute? Thx in advance! |
I honestly don't know System.Text.Json well enough... |
There should be converter samples in those issues (though deserialization is a different matter) that you could copy paste into your app but I think that all hinges on #1107? |
@NinoFloris Hmm I'll check out 'GlobalTypeMapper' tomorrow, certainly worth a try. Thx! |
@NinoFloris I confirm the |
Hello,
This feels more like a question that an actual issue.
But didn't know for sure where to ask otherwise
So I'm playing a bit with the JSON support and I really like it. There is one problem I'm having since internally the 'new' System.Text.Json api is used there is no support for polymorphic serialization and deserialization (dotnet/runtime#30083)
I could easily solve this in the following way:
This perfectly works. But it's a bit tedious to always add this in the model creation.
Is there a better solution like globally replacing System.Text.Json to good 'ol JSON.NET?
Btw I'm using the preview of EF Core 6.
Thanks in advance,
Sincerely, Brecht
The text was updated successfully, but these errors were encountered: