¡@

Home 

c# Programming Glossary: myasyncmethod

How to call an async method from a getter or setter?

http://stackoverflow.com/questions/6602244/how-to-call-an-async-method-from-a-getter-or-setter

pseudo code to help explain myself. async Task IEnumarable MyAsyncMethod return await DoSomethingAsync public IEnumarable MyList get.. await DoSomethingAsync public IEnumarable MyList get call MyAsyncMethod here c# async ctp share improve this question You can't.. Task IEnumarable MyList get Just call the method return MyAsyncMethod Or Make the property blocking public IEnumarable MyList get..

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

http://stackoverflow.com/questions/9343594/how-to-call-asynchronous-method-from-synchronous-method-in-c

then you can use Task.WaitAndUnwrapException var task MyAsyncMethod var result task.WaitAndUnwrapException You do not want to use.. AggregateException . This solution is only appropriate if MyAsyncMethod does not synchronize back to its context. In other words every.. back to its context. In other words every await in MyAsyncMethod should end with ConfigureAwait false . This means it can't update..