Exemplo n.º 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 IStatusGeneric status)
 {
     return(status.ResponseWithValidCode(OkStatusCode));
 }
Exemplo n.º 2
0
 /// <summary>
 /// This will return a result value, with the status Message. There are three possibilities:
 /// 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 IStatusGeneric status, T results)
 {
     return(status.ResponseWithValidCode(results, OkStatusCode));
 }