Пример #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));