Tag Archives: C#

C# – Reflection

By | 20/11/2024

In this post, we will see what Reflection is and how use it in our programs.But first of all, what is Reflection?“Reflection is part of the System.Reflection namespace in C# that enables us to analyse assemblies and types, create instances dynamically, access properties and fields, invoke methods, and even discover custom attributes. Through reflection, we… Read More: C# – Reflection »

Category: C# Tags:

C# – Management of a PostgreSQL database

By | 11/09/2024

In this post, we will see how to manage the PostgreSQL database created in the post “Python – Management of a PostgreSQL database”, using C#.We will define a Minimal API for managing the database using C# and Dapper, combined with the Repository Pattern. Finally, we will add the Unit Test to check that all methods… Read More: C# – Management of a PostgreSQL database »

Unit Test – How to test a Private method in C#

By | 17/04/2024

In this post, we will see how to test a Private method in C#, using Reflection.In unit testing, the conventional wisdom is to test the public interface of a class. This means that private methods, which are implementation details, are typically tested indirectly through public methods. However, there are times when we might want to… Read More: Unit Test – How to test a Private method in… »

Minimal APIs – In Memory Caching

By | 20/03/2024

In this post, we will see how to use In-Memory Caching to improve the performances of our Minimal APIs.But, why should we use caching?“Caching temporarily stores copies of data so future requests for that data can be served faster. The idea is to reduce the number of expensive calls, such as database queries, making the… Read More: Minimal APIs – In Memory Caching »

Design Patterns – Asynchronous Factory

By | 13/03/2024

In this post, we will see how to use the Asynchronous Factory Method pattern in our project.But first of all, what is Asynchronous Factory Method and why should we use it?“In many applications, especially those that involve database operations, initializing data asynchronously during startup is a common requirement. However, constructors in C# do not support… Read More: Design Patterns – Asynchronous Factory »

C# – Concurrent collections

By | 06/03/2024

In this post, we will see some concurrent collections that we could use in our multi-threaded application where, managing shared data between threads, can introduce complexity and potential error such as race conditions or deadlocks. .NET addresses these cases with its concurrent collections, found in the System.Collections.Concurrent namespace. These collections are designed to be thread-safe… Read More: C# – Concurrent collections »

C# – Serilog

By | 24/01/2024

In this post, we will see how to use Serilog in our .net applications.But first of all, what is Serilog?Serilog is a diagnostic logging library for .NET applications. It is designed to be easy to configure and extend, offering a rich set of sinks (outputs) and enrichers. One of the key features of Serilog is… Read More: C# – Serilog »

Category: C# Tags: