using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; namespace System; public class AggregateException : Exception { private List innerExceptions; public ReadOnlyCollection InnerExceptions => new ReadOnlyCollection(innerExceptions); public AggregateException() { innerExceptions = new List(); } public AggregateException(IEnumerable innerExceptions) { this.innerExceptions = innerExceptions.ToList(); } }