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

            return(result);
        }