EntityFramework.Extended icon indicating copy to clipboard operation
EntityFramework.Extended copied to clipboard

Future Async

Open DzheiZee opened this issue 7 years ago • 5 comments

Added async to future queries.

  1. Added async methods, did not remove sync. Both are working correctly. 2.. Added asyncronisity in reader get phase
  2. Added asyncronisity in objects materialization phase.
  3. Added cancellation support throught asynhronous operations.
  4. 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.

DzheiZee avatar Nov 28 '16 04:11 DzheiZee

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.

DzheiZee avatar Nov 28 '16 04:11 DzheiZee

this package seems to bring async to 40:

https://www.nuget.org/packages/AsyncBridge

MagicAndre1981 avatar Dec 01 '16 22:12 MagicAndre1981

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.

DzheiZee avatar Dec 02 '16 14:12 DzheiZee

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.

DzheiZee avatar Dec 05 '16 12:12 DzheiZee

Thank you! That seems to cover all the aspects I left behind in #132 My approach was simplistic in many ways.

israellot avatar Dec 13 '16 20:12 israellot