Result/ResultSuccess/Extensions/ErrorExtensions.cs
/// <summary>
/// Create new error from two errors.
/// </summary>
/// <param name="first">First error.</param>
/// <param name="second">Second error.</param>
/// <param name="generalErrorMessage">General error message for two errors.</param>
/// <returns>New error.</returns>
Create new error from two errors.
Create new error from two errors .
public static Error Concat(this Error first, Error second, string generalErrorMessage)
    {
        if (first is null)
        {
            throw new ArgumentNullException(nameof(first));
        }
        if (second is null)
        {
            throw new ArgumentNullException(nameof(second));
        }
        Error error = Error.CreateError(generalErrorMessage, first.ErrorId);
        first.Details?.ForEach(error.AddErrorDetail);
        second.Details?.ForEach(error.AddErrorDetail);
        return error;
    }
public static Error Concat ( this Error first , Error second , string generalErrorMessage ) { if ( first is null ) { throw new ArgumentNullException ( nameof ( first ) ) ; } if ( second is null ) { throw new ArgumentNullException ( nameof ( second ) ) ; } Error error = Error . CreateError ( generalErrorMessage , first . ErrorId ) ; first . Details ? . ForEach ( error . AddErrorDetail ) ; second . Details ? . ForEach ( error . AddErrorDetail ) ; return error ; }
Create new error from two errors.
Create new error from two errors .
None
Error
this
second
Error
None
generalErrorMessage
string
General error message for two errors.
General error message for two errors .
first
None