Beispiel #1
0
 public void SetError(List <string> errorMessages = null)
 {
     if (!errorMessages?.Any() ?? true)
     {
         errorMessages = GeneralErrorMessage.ToListOfSelf();
     }
     Messages  = errorMessages;
     Succeeded = false;
 }
Beispiel #2
0
        protected HttpResponseMessage CreateErrorMessageResponse(Exception ex)
        {
            GeneralErrorMessage errorMessage = new GeneralErrorMessage();

            errorMessage.Code    = 101;
            errorMessage.Message = ex.Message;
            errorMessage.Detail  = ex.StackTrace;

            return(Request.CreateResponse(HttpStatusCode.BadRequest, errorMessage));
        }