Recently added not in a section yet
Notes tagged dotnet, csharp that this index does not link yet. Added automatically on each build.
- C# general utils1 min · Jul 2025
- C# Streams and Files2 min · Jun 2024
- Servicebus vs queue1 min · Jun 2024
Start here
Meta
- C# coding style2 min
- Code documentation in c#2 min
config
.NET with AI1 note · 2 min
Integrate .NET with AI
Today’s AI landscape moves so fast and providers differ so much that vendor lock-in can become expensive. You need a clean, testeable way to add AI without tying your architecture to one SDK.
C# language27 notes · 2 h 20 min
“basics”
this is a list of c# features good to know for someone like me, coming from a Java background
- Introduction to c#4 min
- c# methods7 min
- Nullables5 min
- c# classes12 min
- Partial classes2 min
- Deconstruction3 min
- Class vs struct vs record (reference types vs value types)7 min
- Expression bodied members2 min
- Pattern matching12 min
- Generics2 min
collections, lists and lambdas
advanced
- Middleware5 min
- Anonymous type objects2 min
- Events (pub/sub)3 min
TAP programming (async / await)
- Parallel code3 min
- Async programming13 min
- Async best practices6 min
- Async with parallelism6 min
- Async with lambdas2 min
C# 12
C# 11
- Raw string literals5 min
APIs7 notes · 24 min
Basic health checks
For many apps, a basic health probe configuration that reports the app’s availability to process request is sufficient to discover the status of the app
How to get headers
This is how to retrieve headers from any call.
Caching (IMemoryCache)
.NET offers several cache types. I’m going to explore here
IMemoryCache which stores data in the memory of the web server. It’s simple but not suitable for distributed scenarios.Validations
C# tiene los
DataAnnotationNewtonsoft
With
NullValueHandling we may omit in the JSON a variable in case it’s null.Dependency injection (& scope types)
Dependency injection is native-available in .NET Core
Dependency injections with multiple implementations
I have the class
package with a type, plus more info not relevant to the question(ORM) Entity Framework Core6 notes · 13 min
Teoria EF Core
En el
Este usa una cadena del
Program tenemos código que depende del nugget y la implementación de la base de datos que vamos a integrar.Este usa una cadena del
appsettings.json para conectar a la BBDDEF Core Scaffolding
Go to
Tools > Nuget Package Manager > Package Manager ConsoleEF Core Global Filters
Let’s set a case where we have the following
User class where we want to soft delete it, as we want to keep deleted records.Read-only statements performance improvement
Cuando se van a realizar consultas de solo lectura, las cuales NO se van a usar para actualizar en la base de datos, se puede llamar al método
Es recomendable utilizarla para manejar grandes volumenes de entidades.
.AsNoTracking() para mejorar la performance.Es recomendable utilizarla para manejar grandes volumenes de entidades.
Data models
You can easily mark fields for a model which are primary key or are required.
EF Core multithreading
I’ve had issues with EF Core when operating with multiple threads and with multiple calls at the same time.
Razor Pages2 notes · 10 min
Basic usage
Con Visual Studio es posible automatizar la creación de CRUDs y sus vistas.
Prevent Overposting
Si las clases contienen secretos, aunque estos no se muestren en la web, hay maneras de introducir datos en un Creation aunque el form no tenga un campo para ello.
