I noticed that when it becomes necessary to work with SQL databases in .Net applications, developers often chose some ORM library (.Net Entity Framework in most cases) without even considering other alternatives. At first glance, this is a reasonable decision, because for popular ORM libraries there are many tutorials, great toolkit, and many experienced developers. However, it is not always a good choice — I would at least consider other options if your application:
If your application mainly implements use cases similar to these ones:
Recently, when I was reviewing the new features that are going to be included in .Net 5, I came across an interesting one — C# Source Generators. This feature especially interested me since I have been using a similar approach for the last… 5 years and what Microsoft proposes is simply a deeper integration of this approach into the build process.
Further I’ll share my experience using Roslyn in code generation and I think this will help you better understand what exactly Microsoft offers and when you can use it.
First, let’s look at a typical code generation scenario. You…
It was a legacy enterprise project and I was asked to improve its “advanced” filtering capabilities.
Before they had something like this:
Almost 100% of asynchronous tasks that you deal with in your C# code are running or already completed regardless of whether you “await” them or not. This can be shown with the following example:
static async Task Main()
var task = GetValueAsync();
Console.WriteLine("Awating..."); Console.WriteLine("Result is: " + await task);
}static async Task<int> GetValueAsync()
Result is: 42
As you see GetValueAsync finished before await but what if the behavior is not desired and you do not want a task to start…
One of the Angular core concepts is the update of a component’s DOM in case the framework detects changes in its fields used in the template binding expressions. This is very convenient since it allows changing the component’s view just by updating the corresponding fields without any direct manipulations with DOM. At the same time, Angular leaves the way of how the component’s fields are updated to a developer and that works well in some simple scenarios since developers can quickly create components which meet all necessary requirements without the need to introduce any additional abstractions. …