About 247,000 results
Open links in new tab
  1. Understanding async / await in C# - Stack Overflow

    I'm starting to learn about async / await in C# 5.0, and I don't understand it at all. I don't understand how it can be used for parallelism. I've tried the following very basic program: using Sys...

  2. c# - How and when to use ‘async’ and ‘await’ - Stack Overflow

    Jan 22, 2013 · If every async method need to have an await inside of it, and a await can only be done on a methods with async, when does it stop?

  3. How to run and interact with an async Task from a WPF gui

    Here is an example using async/await, IProgress<T> and CancellationTokenSource. These are the modern C# and .Net Framework language features that you should be using.

  4. c# - Can constructors be async? - Stack Overflow

    Nov 16, 2011 · And async method can't return just any type, it has to be either “fire and forget” void, or Task. If the constructor of type T actually returned Task<T>, that would be very confusing, I think. If …

  5. c# - Can't specify the 'async' modifier on the 'Main' method of a ...

    Feb 9, 2012 · I am new to asynchronous programming with the async modifier. I am trying to figure out how to make sure that my Main method of a console application actually runs asynchronously. class …

  6. How to call asynchronous method from synchronous method in C#?

    I have a public async Task Foo() method that I want to call from a synchronous method. So far all I have seen from MSDN documentation is calling async methods via async methods, but my whole progra...

  7. c# - How to wait for async method to complete? - Stack Overflow

    The most important thing to know about async and await is that await doesn't wait for the associated call to complete. What await does is it returns the result of the operation immediately and synchronously …

  8. c# - Calling async methods from non-async code - Stack Overflow

    Oct 30, 2016 · Calling async method from non async method Synchronously waiting for an async operation, and why does Wait () freeze the program here Calling an async method from a …

  9. c# - async/await - when to return a Task vs void? - Stack Overflow

    The async void case is a "fire and forget": You start the task chain, but you don't care about when it's finished. When the function returns, all you know is that everything up to the first await has executed. …

  10. c# - Async await and event handler - Stack Overflow

    Aug 27, 2021 · Is it permitted to convert a usual event handler from void to Task based, and await it like below? Something.PropertyChanged += async (o, args) =&gt; await …