Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static T SerializeJsonToObject<string,T>(string jsonObjectRepresentationsToDeserialize, T typeToDeserializeTo)
- {
- T serializedTypeFromJson = _jsonSerializer.Deserialize(jsonObjectRepresentationsToDeserialize, typeToDeserializeTo);
- return serializedTypeFromJson;
- }
- private static T SerializeJsonToObject<T>(string jsonObjectRepresentationsToDeserialize)
- {
- return _jsonSerializer.Deserialize<T>(jsonObjectRepresentationsToDeserialize);
- }
- MyObject obj = SerializeJsonToObject<MyObject>("json object");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement