Result/ResultSuccess/Errors/Error.cs
/// <summary>
/// Create error with error messages.
/// </summary>
/// <param name="generalErrorMessage">General error message.</param>
/// <param name="detailErrorMessages">Detail error message params array.</param>
/// <returns>Error object.</returns>
Create error with error messages.
Create error with error messages .
public static Error CreateError(string generalErrorMessage, params string[] detailErrorMessages)
        {
            Error error = new (generalErrorMessage);
            if (detailErrorMessages?.Any() == true)
            {
                foreach (string detailErrorMessage in detailErrorMessages)
                {
                    Error detailError = new (detailErrorMessage);
                    error.AddErrorDetail(detailError);
                }
            }
            return error;
        }
public static Error CreateError ( string generalErrorMessage , params string [ ] detailErrorMessages ) { Error error = new ( generalErrorMessage ) ; if ( detailErrorMessages ? . Any ( ) == true ) { foreach ( string detailErrorMessage in detailErrorMessages ) { Error detailError = new ( detailErrorMessage ) ; error . AddErrorDetail ( detailError ) ; } } return error ; }
Create error with error messages.
Create error with error messages .
None
generalErrorMessage
string
General error message.
General error message .
detailErrorMessages
Detail error message params array.
Detail error message params array .