Force.com-Toolkit-for-NET icon indicating copy to clipboard operation
Force.com-Toolkit-for-NET copied to clipboard

Not all async methods in ForceClient are implemented asynchronously

Open KE7 opened this issue 8 years ago • 1 comments

Multiple methods in the ForceClient are not implemented asynchronously despite having asynchronous method names.

For example, in ForceClient.cs, there is a method declared as: public Task<QueryResult<T>> QueryAsync<T>(string query)

QueryAsync implies that it queries asynchronously however it is currently done synchronously. Many methods in that file suffer the same issue.

The correct definition should look like: public async Task<QueryResult<T>> QueryAsync<T>(string query)

KE7 avatar Jul 10 '17 16:07 KE7

@KE7 I think you're getting a bit mixed up here.

The async keyword is only required when a method contains the await in the method body. A method that returns a Task<T> or Task can still be asynchronous.

conficient avatar Aug 23 '18 07:08 conficient