2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00

.Net 6 Upgrade

This commit is contained in:
2021-12-01 12:17:45 +03:00
parent 1166e93ba9
commit 530df018ec
164 changed files with 21247 additions and 21425 deletions

View File

@ -28,48 +28,47 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Esiur.Core
namespace Esiur.Core;
public class AsyncBag<T> : AsyncBag
{
public class AsyncBag<T>: AsyncBag
{
public AsyncBag<T> Then(Action<T[]> callback)
{
base.Then(new Action<object>((o) => callback(((object[])o).Select(x=>(T)x).ToArray())));
return this;
}
public void Add(AsyncReply<T> reply)
{
base.Add(reply);
}
public void AddBag(AsyncBag<T> bag)
{
foreach (var r in bag.replies)
Add(r);
}
public new AsyncBagAwaiter<T> GetAwaiter()
{
return new AsyncBagAwaiter<T>(this);
}
public new T[] Wait()
{
return base.Wait().Select(x => (T)x).ToArray();
}
public AsyncBag()
{
}
public AsyncBag(T[] results)
: base(results.Select(x=>(object)x).ToArray())
{
}
public AsyncBag<T> Then(Action<T[]> callback)
{
base.Then(new Action<object>((o) => callback(((object[])o).Select(x => (T)x).ToArray())));
return this;
}
}
public void Add(AsyncReply<T> reply)
{
base.Add(reply);
}
public void AddBag(AsyncBag<T> bag)
{
foreach (var r in bag.replies)
Add(r);
}
public new AsyncBagAwaiter<T> GetAwaiter()
{
return new AsyncBagAwaiter<T>(this);
}
public new T[] Wait()
{
return base.Wait().Select(x => (T)x).ToArray();
}
public AsyncBag()
{
}
public AsyncBag(T[] results)
: base(results.Select(x => (object)x).ToArray())
{
}
}