示例#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);
        }
示例#2
0
        public string SerializeObject(object obj)
        {
            string result = NewtonsoftJsonHelper.Serialize(obj, new NHibernateContractResovler());

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

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

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

            return(result);
        }