Exemple #1
0
 public static AjaxResult resultWith(AjaxResultEnum resultEnum, object data = null)
 {
     return(new AjaxResult
     {
         resultCode = (int)resultEnum,
         resultMsg = resultEnum.ToString(),
         data = data
     });
 }
Exemple #2
0
 public static AjaxResult resultWith(AjaxResultEnum resultEnum, string resultMsg, object data)
 {
     return(new AjaxResult
     {
         resultCode = (int)resultEnum,
         resultMsg = resultMsg,
         data = data
     });
 }
Exemple #3
0
        public static AjaxResult CreateAjaxResultObject(this ResultObject obj)
        {
            AjaxResultEnum @enum = obj.@enum;

            return(new AjaxResult
            {
                code = obj.@enum,
                msg = string.IsNullOrWhiteSpace(obj.msg) ? @enum.GetEnumDescription() : obj.msg,
                data = obj.data
            });
        }