Exemple #1
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            ErrorResult <TError> other = obj as ErrorResult <TError>;

            if (other != null)
            {
                return(Equals(other));
            }
            if (obj.GetType() == typeof(TError))
            {
                return(Equals((TError)obj));
            }
            return(false);
        }
Exemple #2
0
 public bool Equals(ErrorResult <TError> other)
 {
     if (!ErrorCode.Equals(other.ErrorCode))
     {
         return(false);
     }
     if (ErrorMessage != other.ErrorMessage)
     {
         return(false);
     }
     if (_validationErrors != null && other._validationErrors == null)
     {
         return(false);
     }
     if (_validationErrors == null && other._validationErrors != null)
     {
         return(false);
     }
     if (_validationErrors != null && other._validationErrors != null && _validationErrors.Equals(other._validationErrors))
     {
         return(false);
     }
     return(true);
 }
Exemple #3
0
 public void Deconstruct(out TResult result, out ErrorResult <TError> error) => (result, error) = (this.SuccessResult, this.ErrorResult);
Exemple #4
0
 public ErrorResultException(ErrorResult <TError> errorResult)
 {
 }