C# - Catching exceptions from unawaited tasks

I recently stumbled upon some code which looked something like the following: var ct = new CancellationToken(); Task.Run(async () => { while (!ct.IsCancellationRequested) { CallToMethodThatMightThrowAnException(); await Task. »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on .Net, Task, C#

C# - What is the [x..y] range operator?

Almost 5 years ago I made a post on the null-conditional operator (?:) in C#. Now I am following up with a series on different operators. This »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, .Net