<strong>What’s the SynchronizationContext used for?</strong>

What’s the SynchronizationContext used for?

Creating Windows applications, UI controls are bound to the UI thread. .NET made it to different iterations with different patterns dealing with asynchronous programming. .NET 4.0 introduced the Task Parallel Library (TPL) and C# 5 added the async and await keywords. Together with these enhancements of .NET, and the synchronization context, invoking methods that make use of different threads has becoming a lot easier. Continue reading What’s the SynchronizationContext used for?

Upgrading an ASP.NET Core Web API Project to .NET 6

Upgrading an ASP.NET Core Web API Project to .NET 6

Upgrading an ASP.NET Core 5 application to .NET 6, all what needs to be done is to change the project file for .NET 6, and update the NuGet packages to the new versions, and you’re done and can build and run the application. However, to take advantage of new features, and reduce the number of source code lines, some things can be changed – as shown in this article. Continue reading Upgrading an ASP.NET Core Web API Project to .NET 6

C# 8 Updates

C# 8 Updates

Bonus chapter for Professional C# 7 and .NET Core 2 with updates for C# 8: nullable reference types, using declaration, readonly members, default interface members, async streams, switch expressions, pattern matching enhancements, indices and ranges, and more! Continue reading C# 8 Updates

How Hello World! changed – top level statements and functions (C# 9)

How Hello World! changed – top level statements and functions (C# 9)

C# 9 comes with many new features to enhance productivity and fix bugs. One productivity enhancement comes for small and simple programs also helps learning C#: top level statements. This also allows for a new way to create a “Hello World” program with C#. It’s not the first time that a new C# language feature made a change for “Hello World”. This also happened with C# 6. Let’s come on a tour how “Hello World” changed during the C# years, and what’s going on with top level statements and functions. Continue reading How Hello World! changed – top level statements and functions (C# 9)