Vibrant discussion about CSLA .NET and using the framework to build great business applications.
Hi. I just figured out that BeginFetch is not asynchronous in Csla 4.5.
I'm using .net 4.0 and before I updated to the Csla 4.5 everything worked fine, but right now all calles become synchronous and it's a huge problem.
How can I get back to work BeginFetch as asynchornous method?
I'm using WPF windows application, .net framework 4.0 Client Profile.
Thanks in advance.
PS: I tried to read books but there are no information about this issue.
In the current 4.5 implementation, when using the local data portal the async methods don't automatically spin the work onto a background thread.
That will change in an upcoming release, because I solicited feedback on this implementation and most people feel that the local data portal should emulate the remote data portal. That will add extra overhead in some cases (because CSLA will always do the work on a background thread), but it will make the local and remote data portal behaviors the same.
In the meantime, you can make your DataPortal_XYZ methods return async Task, and inside your method you can use Task.StartNew to make the work occur on your own background thread.
Porting a WPF application from Csla 4.1 to Csla 4.5 should be straightforward: add a reference to Async Targeting Pack. The easiest way is to use NuGet. Have a look at How to install the Async Targeting Pack?
Tiago Freitas Leal, CslaGenFork (Open Source CSLA code generator)
Maybe I'm doing something wrong, or I need to do something more except adding Async Targeting Pack.
Because right now nothing changed BeginFetch still synced.
I'll do like you suggesting.
PS: Waiting for the CSLA with async local dataportal :)