I am using the DataPortal_Execute methods in my command objects. I call them from the Command's Factory Method:
DataPortal.BeginExecute(Of MyCommandObj)(cmd, callback)
I call the Factory Methods from a ViewModel (WPF) using a Lambda expression for the callback.
The code never runs as Async.
I am not sure if this is a bug or if I don't know what I am doing, but if I change this code in the DataPortalT.cs in CSLA, it works:
This code change is in the BeginExecute(T command, object userState) method.
var result = await DoUpdateAsync(command, false); *** I changed the isSync parameter value to False ***
Am I on the right track here?
Thanks for your help.
Ben
That does look like a bug. I think the code should actually look like this:
public async void BeginExecute(T command, object userState) { try { var result = await UpdateAsync(command); OnExecuteCompleted(new DataPortalResult<T>(result, null, userState)); }
The same bug is in BeginUpdate too.
Rocky,
I changed the BeginExecute as you suggested and that worked great!
Thanks,
Ben
Great! I appreciate your help!
Copyright (c) Marimer LLC