EntityFramework.Extended
EntityFramework.Extended copied to clipboard
Future Async
Added async to future queries.
- Added async methods, did not remove sync. Both are working correctly. 2.. Added asyncronisity in reader get phase
- Added asyncronisity in objects materialization phase.
- Added cancellation support throught asynhronous operations.
- Covered aditional functionality with additional unit test.
Usage: for FutureQuery<T> - fq.ToListAsyn(cancelationTokeOptional) for FutureValue<T>, FutureCount and FutureFirstOrDefault<T> - f.GetValueAsync(cancelationTokeOptional)
I know there is already effort to cover this in https://github.com/loresoft/EntityFramework.Extended/pull/132 but that proposition lacks in some ways.
Removed my changes from .net40 version. If someone know how to acomplish async support in net40 be my guest and make propositions/changes. Personaly for me .net45 support is enough. Async was introduced with C#5.0 and net45.
this package seems to bring async to 40:
https://www.nuget.org/packages/AsyncBridge
Well if going down this road then https://www.nuget.org/packages/Microsoft.Bcl.Async/ would sound better as a dependency for users of library. But i have not used nether of them so just need to try.
Looked deeper, and conclusion, it look like it is imposible. It is because EntityFramework for .net40 does not support async. Shaper<T> does not implements IDbAsyncEnumerator<T>, and it does in .net45 version.
Thank you! That seems to cover all the aspects I left behind in #132 My approach was simplistic in many ways.