I have installed async package in .net 4.0. this gives me the ability to use async / await keywords in my applications.
as i have understood until now i can use wrap my task.run code in async / await and have the same result as using task.run with continuewith.
Is this true? or there are deeper differences?
It depends on what you’re doing with
ContinueWith. But yes, often you can useawaitto achieve the same effects you’d previously have achieved usingContinueWith. What you can’t do is things like “continue with this code only on failure” – you just use normal exception handling for that. As AlexH says, there will be further differences in terms of the overall behaviour of yourasyncmethod – but in most cases I’d say that’s desirable. Basically, the asynchrony of the code flows, so async methods tend to call more async methods, etc.I suggest you read up on what
async/awaitis about (there are loads of resources out there – I’d recommend the “Consuming the Task-based Asynchronous Pattern” page on MSDN as one starting point.