Beispiel #1
0
        public string Serialize <T>(T obj, params string[] properties) where T : new()
        {
            string result;

            if (properties.Length > 0)
            {
                result = NewtonsoftJsonHelper.Serialize(obj, new DynamicContractResolver <T>(properties));
            }
            else
            {
                result = NewtonsoftJsonHelper.Serialize(obj);
            }
            return(result);
        }
Beispiel #2
0
        public string SerializeObject(object obj)
        {
            string result = NewtonsoftJsonHelper.Serialize(obj, new NHibernateContractResovler());

            return(result);
        }
Beispiel #3
0
        public object DeserializeObject(string value, Type t)
        {
            object result = NewtonsoftJsonHelper.DeserializeObject(value, t);

            return(result);
        }
Beispiel #4
0
        public T DeserializeAnonymous <T>(string value, T anonymousObject)
        {
            T result = NewtonsoftJsonHelper.DeserializeAnonymous(value, anonymousObject);

            return(result);
        }
Beispiel #5
0
        public T Deserialize <T>(string value)
        {
            T result = NewtonsoftJsonHelper.Deserialize <T>(value);

            return(result);
        }