I have this method in my service:
public virtual async Task FindByIdAsync(string userId) { this.ThrowIfDisposed(); if (userId == null)
this
async
If you cannot use await, use a code like following.
await
Task task = TaskFindByIdAsync(); task.Wait(); //Blocks thread and waits until task is completed User resultUser = task.Result;