C#

Using Roslyn C# compiler in .NET 5

Posted on
csharp-roslyn-logo

.NET Compiler Platform, also known by its nickname Roslyn, is a set of open-source compilers and code analysis APIs for C# and Visual Basic .NET languages. The primary features of Roslyn are to provide compilers and APIs for code analysis and refactoring. There is a splendid must-read article about Roslyn entitled How Microsoft rewrote its […]

.Net Core

C# 9: Top-level statements

Posted on

C# is awesome programming language. The C# team at Microsoft is adding new features with every new version of the language. And forthcoming version C# 9 is no exception. Among other nice features, there will also be a feature called Top-level statements. You can read more about proposal on this link https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/top-level-statements. Furthermore, you can […]

C#

Moving from Event-based asynchronous pattern (EAP) to Task-based asynchronous pattern (TAP) with cancellation

Posted on
cs-async-logo

What’s the point of this blog post? In modern C#/.NET ecosystem there is encouragement to use async/await Task based asynchronous model over other asynchronous patterns and approaches. On the other side, there are still a lot of libraries (legacy, wrappers from other technologies/languages which uses events for callback calls, etc…) which use older EAP approach […]

.Net Core

C#: From Event-based Asynchronous Pattern to Task-based Asynchronous Pattern

Posted on
cs-async-logo

Task-based Asynchronous Pattern (TAP) was introduced in .NET Framework 4 and since then, it is the recommended approach to asynchronous programming in .NET.

Event-based Asynchronous Pattern (EAP) is still in use, especially at legacy systems, but for new development is not recommended anymore.

In this post I will show how to wrap EAP into TAP and use more modern approach.