public SendCommandResult(SendCommandResultType type)
 {
     if (!IsSuccessType(type)) throw new ArgumentOutOfRangeException(nameof(type));
     if (!Enum.IsDefined(typeof (SendCommandResultType), type))
         throw new ArgumentOutOfRangeException(nameof(type));
     Type = type;
 }
 public SendCommandResult(SendCommandResultType type, Exception exception)
 {
     if (exception == null) throw new ArgumentNullException(nameof(exception));
     if (!Enum.IsDefined(typeof (SendCommandResultType), type))
         throw new ArgumentOutOfRangeException(nameof(type));
     if (type.IsNotOneOf(SendCommandResultType.ProcessingError, SendCommandResultType.PersistenceFailed)) throw new ArgumentOutOfRangeException(nameof(type));
     Type = type;
     Exception = exception;
 }
 public SendCommandResult(SendCommandResultType type, IEnumerable<KeyValuePair<string, string>> errors)
 {
     if (errors == null) throw new ArgumentNullException(nameof(errors));
     if (IsSuccessType(type)) throw new ArgumentOutOfRangeException(nameof(type));
     if (!Enum.IsDefined(typeof(SendCommandResultType), type))
         throw new ArgumentOutOfRangeException(nameof(type));
     Type = type;
     Errors = errors;
 }
Ejemplo n.º 4
0
 public SendCommandResult(SendCommandResultType type)
 {
     if (!IsSuccessType(type))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     if (!Enum.IsDefined(typeof(SendCommandResultType), type))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     Type = type;
 }
Ejemplo n.º 5
0
 public SendCommandResult(SendCommandResultType type, Exception exception)
 {
     if (exception == null)
     {
         throw new ArgumentNullException(nameof(exception));
     }
     if (!Enum.IsDefined(typeof(SendCommandResultType), type))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     if (type.IsNotOneOf(SendCommandResultType.ProcessingError, SendCommandResultType.PersistenceFailed))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     Type      = type;
     Exception = exception;
 }
Ejemplo n.º 6
0
 public SendCommandResult(SendCommandResultType type, IEnumerable <KeyValuePair <string, string> > errors)
 {
     if (errors == null)
     {
         throw new ArgumentNullException(nameof(errors));
     }
     if (IsSuccessType(type))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     if (!Enum.IsDefined(typeof(SendCommandResultType), type))
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     Type   = type;
     Errors = errors;
 }
 private static bool IsSuccessType(SendCommandResultType type)
 {
     return type.IsOneOf(SendCommandResultType.Accepted, SendCommandResultType.Completed);
 }
Ejemplo n.º 8
0
 private static bool IsSuccessType(SendCommandResultType type)
 {
     return(type.IsOneOf(SendCommandResultType.Accepted, SendCommandResultType.Completed));
 }