Esempio n. 1
0
 protected JsonResult Json(IEnumerable <SimplyResult> results)
 {
     return(Json(results.Select(r => r.IsSuccess
         ? WebApiResponse.Ok()
         : WebApiResponse.Fail(new ErrorDescriber {
         Code = r.ErrorCode, Description = r.ErrorMessage
     }))));
 }
Esempio n. 2
0
 protected JsonResult Json(SimplyResult result)
 {
     return(result.IsSuccess
         ? Json(WebApiResponse.Ok())
         : Json(result.ErrorCode, result.ErrorMessage));
 }
Esempio n. 3
0
 protected JsonResult Json <T>(SimplyResult <T> result)
 {
     return(result.IsSuccess
         ? Json(WebApiResponse.Ok(result.Data))
         : Json(result.ErrorCode, result.ErrorMessage, result.Data));
 }
Esempio n. 4
0
 protected JsonResult Ok <T>(T data)
 {
     return(Json(WebApiResponse.Ok(data)));
 }