diff --git a/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj b/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
index 58dc39b..89fa366 100644
--- a/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
+++ b/Esyur.Stores.MongoDB/Esyur.Stores.MongoDB.csproj
@@ -14,6 +14,16 @@
1.3.0
+
+
+
+
+
+
+
+
+
+
diff --git a/Esyur/Core/AsyncAwaiter.cs b/Esyur/Core/AsyncAwaiter.cs
index 9766ed2..4bedac1 100644
--- a/Esyur/Core/AsyncAwaiter.cs
+++ b/Esyur/Core/AsyncAwaiter.cs
@@ -6,20 +6,21 @@ using System.Threading.Tasks;
namespace Esyur.Core
{
- public class AsyncAwaiter : INotifyCompletion
+ public class AsyncAwaiter : INotifyCompletion
{
Action callback = null;
AsyncException exception = null;
- T result;
+ object result;
+
public AsyncAwaiter(AsyncReply reply)
{
reply.Then(x =>
{
this.IsCompleted = true;
- this.result = (T)x;
+ this.result = x;
this.callback?.Invoke();
}).Error(x =>
{
@@ -29,7 +30,7 @@ namespace Esyur.Core
});
}
- public T GetResult()
+ public object GetResult()
{
if (exception != null)
throw exception;
@@ -47,6 +48,6 @@ namespace Esyur.Core
callback = continuation;
}
-
+
}
}
diff --git a/Esyur/Core/AsyncAwaiterGeneric.cs b/Esyur/Core/AsyncAwaiterGeneric.cs
new file mode 100644
index 0000000..095f9b9
--- /dev/null
+++ b/Esyur/Core/AsyncAwaiterGeneric.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Esyur.Core
+{
+ public class AsyncAwaiter : INotifyCompletion
+ {
+ Action callback = null;
+
+ AsyncException exception = null;
+
+ T result;
+
+ public AsyncAwaiter(AsyncReply reply)
+ {
+ reply.Then(x =>
+ {
+ this.IsCompleted = true;
+ this.result = (T)x;
+ this.callback?.Invoke();
+ }).Error(x =>
+ {
+ exception = x;
+ this.IsCompleted = true;
+ this.callback?.Invoke();
+ });
+ }
+
+ public T GetResult()
+ {
+ if (exception != null)
+ throw exception;
+ return result;
+ }
+
+ public bool IsCompleted { get; private set; }
+
+ public void OnCompleted(Action continuation)
+ {
+ if (IsCompleted)
+ continuation?.Invoke();
+ else
+ // Continue....
+ callback = continuation;
+ }
+
+
+ }
+}
+
diff --git a/Esyur/Core/AsyncBag.cs b/Esyur/Core/AsyncBag.cs
index be2ead4..8819777 100644
--- a/Esyur/Core/AsyncBag.cs
+++ b/Esyur/Core/AsyncBag.cs
@@ -46,9 +46,9 @@ namespace Esyur.Core
return this;
}
- public new AsyncAwaiter