3 ms·
So after toying with it for a couple of hours, here's what I've seen: I think if the method is named 'Async' (such as GetReplyAsync() *) , you can call it asyn
by varunsrin 15y ago
So after toying with it for a couple of hours, here's what I've seen:
I think if the method is named 'Async' (such as GetReplyAsync() *) , you can call it asynchronously with the new await in C#, and using Task<T> as the return type. Only methods that are lableled async implement the new 'await'.
Some of the old .NET methods had 2 API's - synchronous & asyncrhonous. Some of the synchronous implementations, as pointed out in your link, have been deprecated.
A few of the async methods I have seen (which do not have Async in the title), only accept the old IAsync/callback and do not work with await. Presumably, they do not implement the new C#5 style of async yet. Hopefully, they will at some point, because I'm a big fan of how clean & readable async C# can be now.
Again I haven't explored C#5.0 thoroughly, these are just my first impressions.