13 lines
497 B
C#
13 lines
497 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Converter
|
|
{
|
|
public static class CustomJsonConverter
|
|
{
|
|
public static T DeserializeJsonToObject<T>(string json) where T : class, new()
|
|
=> !string.IsNullOrWhiteSpace(json) ? JsonConvert.DeserializeObject<T>(json) : null;
|
|
|
|
public static string SerializeObjectToJson(object myObject)
|
|
=> (myObject != null) ? JsonConvert.SerializeObject(myObject) : string.Empty;
|
|
}
|
|
}
|