result/src/Result/Errors/AggregateError.cs
Louis Seubert 2a5c134d9f
All checks were successful
default / dotnet default workflow (8.0) (push) Successful in 39s
chore: add copyright header
2024-05-01 18:30:15 +02:00

19 lines
No EOL
603 B
C#

// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
namespace Geekeey.Extensions.Result;
/// <summary>
/// An error which is a combination of other errors.
/// </summary>
/// <param name="errors">The errors the error consists of.</param>
public sealed class AggregateError(IEnumerable<Error> errors) : Error
{
/// <summary>
/// The errors the error consists of.
/// </summary>
public IReadOnlyCollection<Error> Errors { get; } = errors.ToList();
/// <inheritdoc/>
public override string Message => string.Join(Environment.NewLine, Errors.Select(error => error.Message));
}