Example #1
0
 public static ContentResult BuildContentResult(this CodeMsg codeMsg)
 {
     return(new ContentResult()
     {
         Content = codeMsg.Msg(),
         ContentEncoding = Encoding.Default
     });
 }
Example #2
0
        public static Result Success(object data, CodeMsg codeMsg = null)
        {
            if (codeMsg == null)
            {
                codeMsg = CodeMsg.Success();
            }

            return(new Result(codeMsg.Code(), codeMsg.Msg(), data));
        }
Example #3
0
 public static Error BuildError(this CodeMsg codeMsg)
 {
     return(Error.Build(codeMsg));
 }
Example #4
0
 public static JsonResult BuildJsonResult(this CodeMsg codeMsg)
 {
     return(JsonUtil.Json(codeMsg.Build()));
 }
Example #5
0
 public static Result Build(this CodeMsg codeMsg)
 {
     return(Result.Build(codeMsg));
 }
Example #6
0
 public static Result Error(CodeMsg codeMsg, object data = null)
 {
     return(new Result(codeMsg.Code(), codeMsg.Msg(), data));
 }