.NET 8 brings Native AOT to ASP.NET Core, but many frameworks and libraries rely on unbound reflection internally and thus cannot support this scenario yet. This is true for ORMs, too: EF Core and Dapper will only bring full support for Native AOT in later releases. In this post, we will implement a database access layer with Sessions using the Humble Object pattern to get a similar developer experience. We will use Npgsql as a plain ADO.NET provider targeting PostgreSQL.
Archive: our articles
Originally introduced in .NET 7, Native AOT can be used with ASP.NET Core in the upcoming .NET 8 release. In this post, we look at the benefits and drawbacks from a general perspective and perform measurements to quantify the improvements on different platforms.
In this article we will see how to reduce the resource consumption of a Source Generator when running inside an IDE by redirecting the code generation to RegisterImplementationSourceOutput.
As a backend developer you have to implement some kind of periodically running background jobs from time to time. Most widely used tools I see are timers, tasks, semaphores, half dozens of booleans and enums to keep the state. Depending on the complexity of the code, understanding it can be quite adventurous. Alas, almost none of the developers I asked about reactive extensions (Rx.NET) know that they even exist.
With the version 4.3.1 of Microsoft.CodeAnalysis.* Roslyn provides a new high-level API – the method “ForAttributeWithMetadataName”. Although it is just 1 method, still, it addresses one of the biggest performance issue with Source Generators.
With the rise of powerful AI models and services, questions come up on how to integrate those into our applications and make reasonable use of them. While other languages like Python already have popular and feature-rich libraries like LangChain, we are missing these in .NET and C#. But there is a new kid on the block that might change this situation. Welcome Semantic Kernel by Microsoft!
There is this popular quote by Jamie Zawinski: Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.”
In this second article of our short performance series, we want to look at the latter one of those problems.