Category Archives: C#

C# – Bogus

By | 03/08/2022

In this post, we will see how to use the library Bogus.net.But first of all, what is Bogus?Bogus is a library for generating fake data and it is based on the Faker.js. Here, we can find all information and the source code. We start creating a Console application called TestBogus where, we will install Bogus… Read More »

Category: C# Tags:

C# – WhenAll vs WaitAll

By | 27/07/2022

In this post, we will see the differences between WhenAll and WaitAll in the Asynchronous Programming. We start creating a Console Application called TestAysncAwait where, we will add two classes called ClassWaitAllTest and ClassWhenAllTest: [CLASSWAITALLTEST.COM] [CLASSWHENALLTEST.COM] Then, we modify the Program.cs file in order to run and testing ClassWaitAllTest: [PROGRAMM.CS] We have done and now,… Read More »

Category: C# Tags:

C# – Task and Cancellation Token

By | 20/07/2022

In this post, we will see how to use a Cancellation Token in a Task.But first of all, what is a Cancellation Token?From Microsoft web site:“A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects“.In a nutshell, when we run a Task and we decide to cancel it, using a cancellation token we will stop… Read More »

C# – AutoMapper

By | 29/06/2022

In this post, we will see how to configure and use AutoMapper in a Web API project.But first of all, what is AutoMapper?From official web site:“AutoMapper is an object-object mapper. Object-object mapping works by transforming an input object of one type into an output object of a different type. What makes AutoMapper interesting is that… Read More »

Category: C# Tags:

C# – “ValueOf” library

By | 15/06/2022

In this post, we will see the library ValueOf that we could use for validating our classes.But first of all, what is the purpose of ValueOf?From the GitHub page:“The Smell: Primitive Obsession is using primitive data types to represent domain ideas. For example, we use a String to represent a message, an Integer to represent… Read More »

Category: C# Tags:

C# – Redis Cache

By | 06/04/2022

In this post, we will see how to manage Redis Cache in a Web API .NET Core project.But first of all, what is Redis Cache?From Redis web site:“Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes,… Read More »

Category: C# Tags:

C# – GraphQL API query in ASP.NET Core (Part I)

By | 16/03/2022

In this post, we will see how to create and consume GraphQL API query using .NET Core.But first of first, what is GraphQL?From GraphQL website:“GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API,… Read More »

Category: C# Tags: