Closed DavidKlempfner closed 11 months ago
No. That's not correct here, and will effectively jam your execution (I would say block your thread, but the async, threadless version of blocking a thread)
If you want to await it to get a result, you must do that after the execute, by storing the pending result in a local:
bar pending = tran.HashSetAsync(custKey, "UniqueID", newId);
bool committed = tran.Execute();
bar result = await pending;
No. That's not correct here, and will effectively jam your execution (I would say block your thread, but the async, threadless version of blocking a thread)
If you want to await it to get a result, you must do that after the execute, by storing the pending result in a local:
bar pending = tran.HashSetAsync(custKey, "UniqueID", newId); bool committed = tran.Execute(); bar result = await pending;
I understand now, thanks!
Using await for an async method.