public INonEmptyStringState ResolveFor(IOperationError error) { foreach (IOperationErrorMessageSpecification operationErrorMessageSpecification in ErrorSpecifications) { switch (error.Exception) { case AggregateException ae: foreach (Exception innerException in ae.InnerExceptions) { if (innerException.InnerException == null && operationErrorMessageSpecification.Match(innerException) is NonEmptyString leaf) { return(leaf); } // do one level of nesting if (operationErrorMessageSpecification.Match(innerException.InnerException) is NonEmptyString nodeParent) { return(nodeParent); } } break; case Exception exception when operationErrorMessageSpecification.Match(exception) is NonEmptyString matched: return(matched); } } return(new DefaultOperationErrorSpecification().Match(error.Exception)); }
public OperationResult(IOperationError error) : base(error) { }
new public static OperationResult <T> FromError(IOperationError error) => new OperationResult <T>(error);
internal protected OperationResult(IOperationError error) : base(error) { }
public static OperationResult FromError(IOperationError error) => new OperationResult(error);
public InvalidDatabaseSchema(IOperationError error) { Error = error; }
internal protected OperationResult(IOperationError error) { IsSuccess = false; _error = error ?? throw new ArgumentNullException(nameof(error)); }