Earn income with your C# skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

How to call an asynchronous method from a synchronous method in C#.

Use the Result property on the asynchronous Task, like so:

// Synchronous method

void Method() 
    var task = MethodAsync();
    var result = task.Result;

// Asynchronous method

public async Task<int> MethodAsync() 
    return await Task.Run(() => { return 1; });

Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas.      Vsn 1.3.0