private static void InitDeserializer() { DeserializeProxy <object> .DeserializeFunc = (content, type) => DeserializeProxy <string> .DeserializeFunc(content.ToString(), type); DeserializeProxy <string> .DeserializeFunc = JsonConvert.DeserializeObject; DeserializeProxy <byte[]> .DeserializeFunc = (content, type) => DeserializeProxy <string> .DeserializeFunc(Encoding.UTF8.GetString(content), type); }
public static object Deserialize <T>(T content, Type type) { return(DeserializeProxy <T> .DeserializeFunc(content, type)); }
public static TResult Deserialize <T, TResult>(T content) where TResult : class { return(DeserializeProxy <T> .DeserializeFunc(content, typeof(TResult)) as TResult); }
public object Deserialize(string data, Type type) { return(DeserializeProxy <string> .DeserializeFunc(data, type)); }
public object Deserialize <T>(T data, Type type) { return(DeserializeProxy <T> .DeserializeFunc(data, type)); }
public TResult Deserialize <T, TResult>(T data) where TResult : class { return(DeserializeProxy <T> .DeserializeFunc(data, typeof(TResult)) as TResult); }