-
Notifications
You must be signed in to change notification settings - Fork 84
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
Use System.Text.Json instead of Newtonsoft #9
Comments
Agreed, seems like a good addition! |
Hi @andrewlock, I am up for implementing this, but I need your opinion. I think it's good idea to enable to pick which serializer you want to use, and have support for both This requires changes in // no provider needed
[StronglyTypedId(generateJsonConverter: false, backingType: StronglyTypedIdBackingType.Int)]
// old behavior, generates converter for Newtonsoft.Json
[StronglyTypedId(backingType: StronglyTypedIdBackingType.Int)]
// one specific
[StronglyTypedId(jsonConverter: StronglyTypedIdJsonProvider.NewtonsoftJson, backingType: StronglyTypedIdBackingType.Int)]
[StronglyTypedId(jsonConverter: StronglyTypedIdJsonProvider.SystemTextJson, backingType: StronglyTypedIdBackingType.Int)]
// both of them, because why not?
[StronglyTypedId(jsonConverter: StronglyTypedIdJsonProvider.NewtonsoftJson | StronglyTypedIdJsonProvider.SystemTextJson, backingType: StronglyTypedIdBackingType.Int)] Are you okay with that approach? |
Sounds good to me, thanks! 🙂 |
ASP.Net Core 3.1 uses System.Text.Json to serialize objects. It would be good to support this new method of serialization.
I currently use the following (obviously it would need adapting to support the relevant use cases in this package).
This issue depends upon #5
The text was updated successfully, but these errors were encountered: