예제 #1
0
 /// <summary>
 /// Creates <see cref="JsonResult"/> using <see cref="JsonResponse"/> as data source.
 /// </summary>
 /// <param name="msg">The operation message or another description.</param>
 /// <returns>The json result.</returns>
 protected JsonResult JsonSuccess(string msg) => Json(JsonResponse.Make(msg));
예제 #2
0
 /// <summary>
 /// Creates <see cref="JsonResult"/> using <see cref="JsonResponse"/> as data source with error flag.
 /// </summary>
 /// <param name="ex">The exception object.</param>
 /// <returns>The json result.</returns>
 protected JsonResult JsonError(Exception ex) => Json(JsonResponse.Make(true, ex.Message));
예제 #3
0
 /// <summary>
 /// Creates <see cref="JsonResult"/> using <see cref="JsonResponse"/> as data source.
 /// </summary>
 /// <param name="payload">The payload object.</param>
 /// <returns>The json result.</returns>
 protected JsonResult JsonSuccess(object payload) => Json(JsonResponse.Make(payload));
예제 #4
0
 /// <summary>
 /// Creates <see cref="JsonResult"/> using <see cref="JsonResponse"/> as data source with error flag.
 /// </summary>
 /// <param name="msg">The error message.</param>
 /// <returns>The json result.</returns>
 protected JsonResult JsonError(string msg) => Json(JsonResponse.Make(true, msg));