/// <summary> /// Method is called to create a <see cref="HttpResponseMessage"/> with <see cref="HttpStatusCode.BadRequest"/> /// and a message <see cref="DefaultErrorMessage"/> /// </summary> /// <param name="actionContext"></param> protected virtual void CreateErrorResponse(HttpActionContext actionContext) { actionContext.Response = ResponseGenerator.CreateResponseCustom(actionContext.Request, HttpStatusCode.BadRequest, new List <string> { DefaultErrorMessage }); }
/// <summary> /// Creates a <see cref="HttpResponseMessage"/> with <see cref="ErrorResponseStatus.BadRequest"/> and error messages /// </summary> /// <param name="actionContext"></param> /// <param name="errorList"></param> protected virtual void CreateValidationErrorResponse(HttpActionContext actionContext, List <string> errorList) { actionContext.Response = ResponseGenerator.CreateResponseCustom(actionContext.Request, HttpStatusCode.BadRequest, errorList); }