Пример #1
0
 public static async Task AddAsync <T>(this ICollectionAdder <T> collection, IEnumerable <T> items, CancellationToken token = default)
 {
     if (items?.Any() == true)
     {
         await collection.Add(items, (_, __, ex) => throw ex, token);
     }
 }
Пример #2
0
        public static async Task AddWithResume <T>(this ICollectionAdder <T> collection, IEnumerable <T> items, CancellationToken token = default)
        {
            if (items?.Any() != true)
            {
                return;
            }

            await collection.Add(items, (_, __, ex) => new Failure <T, Exception>(ex), token);
        }
Пример #3
0
 public static void Add <T>(this ICollectionAdder <T> collection, params T[] items)
 {
     collection.Add((IEnumerable <T>)items);
 }