Exemplo n.º 1
0
 public static StatusResult Failed(IEnumerable <CommandError> errors, string commandId = null, string state = null, string stateMessage = null)
 => new StatusResult
 {
     CommandId    = commandId,
     Code         = StatusCodes.Status200OK,
     Status       = "Failed",
     State        = string.IsNullOrWhiteSpace(state) ? null : state,
     StateMessage = string.IsNullOrWhiteSpace(stateMessage) ? null : stateMessage,
     Errors       = errors?.Select(error => ResultError.Failed(error)).ToList() ?? new List <ResultError>()
 };
Exemplo n.º 2
0
 public static StatusResult Failed(IList <Exception> exceptions, string commandId = null, string state = null, string stateMessage = null)
 => new StatusResult
 {
     CommandId    = commandId,
     Code         = StatusCodes.Status200OK,
     Status       = "Failed",
     State        = string.IsNullOrWhiteSpace(state) ? null : state,
     StateMessage = string.IsNullOrWhiteSpace(stateMessage) ? null : stateMessage,
     Errors       = exceptions?.Select(e => ResultError.Failed(e)).ToList() ?? new List <ResultError>()
 };