C# 返回JSON格式化统一标准

 

 

public class BackJson
    {
        public int code { get; set; }
        public string msg { get; set; }
        public string data { get; set; }
        //返回json格式结果
        public string back(int code, string msg, string data)
        {
            this.code = code;
            this.msg = msg;
            this.data = data;

            return CommonData.JSSerializer.Serialize(this);
        }
    }

 

posted @ 2017-09-22 17:02 araki 阅读(...) 评论(...) 编辑 收藏