Last active
December 6, 2022 17:34
-
-
Save pedrohenriquebr/73df6a8e745ac574252426dca558abcd to your computer and use it in GitHub Desktop.
PayloadConverter - used for value conversions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PayloadConverter<T>: ValueConverter<T, string> | |
| { | |
| public PayloadConverter() | |
| : base(from => JsonSerializer.Serialize(from, (JsonSerializerOptions) null), | |
| to => JsonSerializer.Deserialize<T>(to, (JsonSerializerOptions) null)) | |
| { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment