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 })))); }
protected JsonResult Json(SimplyResult result) { return(result.IsSuccess ? Json(WebApiResponse.Ok()) : Json(result.ErrorCode, result.ErrorMessage)); }
protected JsonResult Json <T>(SimplyResult <T> result) { return(result.IsSuccess ? Json(WebApiResponse.Ok(result.Data)) : Json(result.ErrorCode, result.ErrorMessage, result.Data)); }
protected JsonResult Ok <T>(T data) { return(Json(WebApiResponse.Ok(data))); }