예제 #1
0
 public static JsonResult ToJsonResultModel(this ResultModel resultModel)
 {
     if (resultModel.IsSuccess)
     {
         return(JsonResultModel.Success(resultModel.Message, resultModel.Data));
     }
     else
     {
         return(JsonResultModel.Error(resultModel.Message));
     }
 }
 public static JsonResult ToJsonResultModel <T>(this Result <T> result)
 {
     if (result.IsSuccess)
     {
         return(JsonResultModel.Success(result.Message, result.Data));
     }
     else
     {
         return(JsonResultModel.Error(result.Message));
     }
 }