Profile cover photo
Profile photo
Scott Gartner
29 followers
29 followers
About
Posts

Post has attachment
Good bye and good riddance
Add a comment...

Post has attachment
Add a comment...

Post has attachment
No words needed, just watch.
Add a comment...

Post has attachment
A great review.
Add a comment...

Post has attachment
Fantastic tour of the ISS!
Add a comment...

Post has attachment
Scott Gartner commented on a post on Blogger.
Good stuff, but your code sample on the await added functionality doesn't really match what you indicated. 

You wrote, "In those times we [do not] need to wait for that execution to be completed before going to next line of execution. So using the await keyword [the] execution will be asynchronous."

The await keyword makes the current thread pause and wait for the asynchronous method to complete, so in your example we absolutely will wait for the execution of LogManager.Write to be completed.  If you didn't want to wait for LogManager.Write to finish you would call the asynchronous method without the await keyword (but then you would have to explicitly handle any exceptions thrown by the method, possibly with ContinueWith or ConfigureAwait).

So, the new language addition is really only useful in an async method to call subordinate async methods.  If you were to just use it in synchronous code it would reduce the awaited method to synchronous processing (which can be useful as well).
15 Cool New Features in C# 6.0
15 Cool New Features in C# 6.0
immortalcoder.blogspot.com
Add a comment...

Post has attachment
Wait while more posts are being loaded