What actually happens when using async/await inside a LINQ statement?

I recommend that you not think of this as “using async within LINQ”. Keep in mind what’s in-between the two: delegates. Several LINQ operators take delegates, and async can be used to create an asynchronous delegate. So, when you have an asynchronous method BazAsync that returns a Task: Task BazAsync(TBar bar); then this code results … Read more

ReSharper: setting C# language level for Solution

I added below settings in .sln.DotSettings <s:String x:Key=”/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue”>CSharp50</s:String> This line was added to .csproj.DotSettings when I tried to disable c#6 for a particular project. After adding this line in .sln.DotSettings resharper is reporting an error whenever I am trying to use c# 6.0 feature.

Why can’t I catch an exception from async code?

You have the “Just my code” Option turned on. With this on, it is considering the exception unhandled with respect to “just your code”–because other code is catching the exception and stuffing it inside of a Task, later to be rethrown at the await call and caught by your catch statement. Without being attached in … Read more

Where can I find the C# 5 language specification? [closed]

If you have Visual Studio 2012 installed, you will find specification somewhere there: c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\Specifications\1033\CSharp Language Specification.docx similar with VS2013: c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC#\Specifications\1033\CSharp Language Specification.docx VS2015: c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Specifications\1033\CSharp Language Specification.docx

C# 5.0 async/await feature and Rx – Reactive Extensions

Check also: TPL Dataflow Overview about TDF and Rx: Astute readers may notice some similarities between TPL Dataflow and Reactive Extensions (Rx), currently available as a download from the DevLabs prototypes site. Rx is predominantly focused on coordination and composition of event streams with a LINQ-based API, providing a rich set of combinators for manipulating … Read more

How is async with await different from a synchronous call?

Calling await client.GetStringAsync() yields the execution to the calling method, which means it won’t wait for the method to finish executing, and thus won’t block the thread. Once it’s done executing in the background, the method will continue from where it stopped. If you just call client.GetString(), the thread’s execution won’t continue until this method … Read more

tech