There are a lot of points about best practices when using Entity Framework and LINQ. Sometimes we need to cipher through a lot of information. The goal of this article is to summarize some of the best practices when it comes to using LINQ and Entity Framework in a way that is easy to digest. …
.Net
.NET is a large collection of a bunch of different things really; including compilers, runtimes, programming languages and a bunch of different tools and technologies.
It provides a lot of common functionality that can be tapped into rather than recreating it from scratch.
C# is one language that can be used on .NET. It get compiled initially by Roslyn and can get additional compilation at runtime by RyuJIT. Other languages include F#, which can all be compiled and run against its runtimes.
This works because it’s generally not compiled to a particularly low level language but rather to an Intermediate Language that can be executed by a .NET runtime. The runtime then does the appropriate translations to actual system/hardware calls allowing you to not have to worry about it.
When you create at least C# projects, you have to specify what runtime you’re targeting so that it can be compiled appropriately to work; not just whether it’s Framework or Core, but also the version number since functionality of the same thing may be different.
One of the goals with .NET 5+ is to reduce the confusion by bringing many of the parts together under one umbrella, but it’s going to be a while before that replaced enough existing software to really get rid of the confusion (especially since .NET 5 isn’t going to have Long Term Support).
C# Asynchronous and Parallel Programming Best Practices
I’ve already written about Asynchronous and Parallel programming before here and here. This is one of those subjects that can be tricky and is the source of a lot of bugs. But I feel the posts that I’ve written before might be too long or they are too specialized, hence not very approchable. In this …
Duende Identity Server: Risks of Sharing Clients and Tokens
In the past, I leveraged the open-source Identity Server version 4 (Read about my experience with it here). But recently, Identity Server has become proprietary, offering price plans that are not always seen as favorable. Especially if a company wants to support on premise instances of the app as opposed to SAAS. That means a …
Thread Affinity in Parallel Programming Using TPL
Thread affinity refers to the assignment of threads to specific processors or cores on a multi-core CPU. When a thread is bound to a specific processor or core, it is said to have affinity to that processor or core. This is in contrast to thread migration, where a thread can move between different processors or …
Inheritance in Programming: Best Practices and Valid Use Cases
Inheritance is a powerful concept in programming that allows classes to inherit properties and behavior from parent classes. When used correctly, it can improve code readability, reduce redundancy, and simplify software development. However, when used incorrectly, inheritance can lead to code that is difficult to understand, maintain, and modify. Unfortunately, inheritance is often misused in …
How to use ConfigBuilders for User Secrets Management in Asp.Net MVC 5
When it comes to storing our app secrets, Asp.Net Core has a built-in mechanism to do that out of the box. But this is not the case for Asp.Net MVC 5. For MVC 5, we need to install custom configBuilders packages in order to be able to have the same functionality. There are many other …
How to Customize Windows Terminal and PowerShell Using Fzf, Neovim and Beautify it with Oh My Posh
PowerShell on its own it a very powerful tool. But what if told you can make it even better using some tools that you can install on it? Not only that but you can also make it more beautiful/handsome, perhaps with a bit of a personal touch too? So, in this post I’m going to …
Color Coder: Using Roslyn APIs For Syntax Highlighting
Couple of years ago, I’ve created a Visual Studio extension to colorize things in C#. More specifically I was trying to colorize different programming constructs such as extension methods. So it had to be done in a syntax aware manner as oppose to coloring text. For that I used Roslyn .NET compiler to do this. …
Careful Model Binding JavaScript ISO Date Format to DateTime
It is agreed by the .Net community that DateTime should not be used when we develop .Net applications. You can read more about why that here. In short the least we can do is to use DateTimeOffset instead. But this post is not about the common problems associated with using DateTime. But rather it’s about …