Skip to content

Asynchronously calls

Stanislav Molchanovskiy edited this page Nov 15, 2021 · 1 revision

To execute a request to the web-service asynchronously, you should define the returned type as Task or Task<>:

public interface IMyClient
{
    [GetMethod] Entity Get(int id);              // Sync call
    [GetMethod] Task<Entity> GetAsync(int id);   // Async call
    [PostMethod] void Post(Entity entity);       // Sync call
    [PostMethod] Task PostAsync(Entity entity);  // Async call
}

Clone this wiki locally