Exemple #1
0
        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);
        }
Exemple #2
0
 public static object Deserialize <T>(T content, Type type)
 {
     return(DeserializeProxy <T> .DeserializeFunc(content, type));
 }
Exemple #3
0
 public static TResult Deserialize <T, TResult>(T content) where TResult : class
 {
     return(DeserializeProxy <T> .DeserializeFunc(content, typeof(TResult)) as TResult);
 }
Exemple #4
0
 public object Deserialize(string data, Type type)
 {
     return(DeserializeProxy <string> .DeserializeFunc(data, type));
 }
Exemple #5
0
 public object Deserialize <T>(T data, Type type)
 {
     return(DeserializeProxy <T> .DeserializeFunc(data, type));
 }
Exemple #6
0
 public TResult Deserialize <T, TResult>(T data) where TResult : class
 {
     return(DeserializeProxy <T> .DeserializeFunc(data, typeof(TResult)) as TResult);
 }