Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public static void Add <T>(this ICollectionAdder <T> collection, params T[] items)
 {
     collection.Add((IEnumerable <T>)items);
 }