In my previous project , the signature of the asynchronous method in the code was async void. So DoSomeLengthyStuffAsync and DoSomeMoreStuff run in parallel, race conditions might occur. So DoSomeMoreStuff depends on any of DoSomeLengthyStuffAsync’s side effects, these might or might not yet be available when DoSomeMoreStuff wants to use them. Such a bug can be difficult to fix, because it cannot be reproduced reliably.
Not only this, need to beware of deadlocks; and allow continuation on a different thread. Those are the few common pitfalls about which I need to be careful on working with asynchronous method with async and await keywords.
The async and await keywords provide a great benefit to C# developers by making asynchronous programming easier. Most of the times, user can use them without having to understand the inner workings in detail. At least, as long as the compiler is a good enough validator, the code will behave as intended. However, there are cases when incorrectly written asynchronous code will compile successfully, but still introduce subtle bugs that can be hard to troubleshoot and fix.
Let's get introduce myself with few sentences: I am an individual freelancer developer having 13 years expertise with website design and development; I have a very strong hands with asp.Net, C#, asp.net MVc, asp.net Core and many more. All details about my expertise you will get from profile. Please ping me on your convenient time. I am waiting here for your response.