/// <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));
/// <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));
/// <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));
/// <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));