Web API – Custom Data Annotation

By | 06/10/2021

In this post, we will see how to create a Data Annotation custom to use in a .NET 5 Web API project.First of all, what is a Data Annotation?From Microsoft web site:“The advantage of using the Data Annotation validators is that they enable you to perform validation simply by adding one or more attributes –… Read More »

Azure – How to use Azure Key Vault

By | 29/09/2021

In this post, we well see how to use Azure Key Vault in a console application, in order to store and retrieve a connection string.First of all, what is Azure Key Vault?From Microsoft web site:“Azure Key Vault is a cloud service that provides a secure store for secrets. You can securely store keys, passwords, certificates,… Read More »

Multithreading – Joining Threads

By | 22/09/2021

In this post, we will see how to use the Join method with the Threads in order to allows one thread to wait until another completes the execution. We start creating a Console application where we add three methods in Program.cs called Method1, Method2 and Method3: Then, we modify Main method in order to run… Read More »

C# – Yield

By | 15/09/2021

In this post, we will see how to use the Yield keyword in a C# application.But first of all, what is Yield?From Microsoft web site:“When you use the yield contextual keyword in a statement, you indicate that the method, operator, or get accessor in which it appears is an iterator. Using yield to define an… Read More »

Category: C#

Multithreading – Introduction

By | 08/09/2021

In this post, we will see how to use multithreading in C# in order to have best performances in our applications.Multithread is a very big argument and in this first post, we will just see how to start working with it. But first of all, what does Multithreading mean?From Microsoft web site:“A process is an… Read More »

C# – Use IHttpClientFactory in a console app

By | 25/08/2021

In this post, we will see how to use IHttpClientFactory in a console application, in order to call a WebAPI service that gives us a list of Users like this: The url of this WebAPI is http://localhost:3000/users and I have created this service using Json Server First of all, we create a Console application project… Read More »

Category: C#

Unit Test – Moq

By | 04/08/2021

In this post, we will see how to use Moq in order to create Unit Test for a Class Library project used to manage CRUD operations.But, what is Moq?Moq is a library used to create mock objects that simulate or mimic a real object.Here, we can find the Moq project. First of all, we define… Read More »