Пример #1
0
 /// <summary>
 /// This will return a HTTP 200 with the status message if Valid,
 /// otherwise it will returns a HTTP 400 with the error information in the standard WebAPI format
 /// </summary>
 /// <param name="status"></param>
 /// <returns></returns>
 public static ActionResult <WebApiMessageOnly> Response(this GenericServices.IStatusGeneric status)
 {
     return(status.ResponseWithValidCode(OkStatusCode));
 }
Пример #2
0
 /// <summary>
 /// This will return a result value, with the status Message
 /// 1. If there are no errors and the results is not null it will return a HTTP 200 response
 ///    plus a json containing the message from the status and the results object
 /// 2. If there are no errors but result is  null it will return a HTTP 204 (NoContent) with the status Message
 /// 3. If there are errors it returns a HTTP 400 with the error information in the standard WebAPI format
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="status"></param>
 /// <param name="results"></param>
 /// <returns></returns>
 public static ActionResult <WebApiMessageAndResult <T> > Response <T>(this GenericServices.IStatusGeneric status, T results)
 {
     return(status.ResponseWithValidCode(results, OkStatusCode));
 }