Tag Archives: C#

C# – Code Snippets

By | 02/11/2022

In this post, we will see how to use Code Snippets and how to create a custom one.But first of all, what is a Code Snippet?From Microsoft web site:“Code snippets are ready-made snippets of code you can quickly insert into your code. For example, the for code snippet creates an empty for loop.You can insert a code snippet at… Read More »

Category: C# Tags:

C# – How to ping an IP/Address with .NET Core

By | 28/09/2022

In this post, we will see how to ping an IP or Address with .net Core. We start creating a Console application called CheckIP where, we will define a class called CheckService so defined: [CHECKSERVICE.CS] Finally, we modify Program.cs in order to use the class CheckService: [PROGRAM.CS] We have done and now, if we run… Read More »

Category: C# Tags:

C# – 10

By | 31/08/2022

In this post, we will see three interesting features introduced with C# 10.For the complete list of all new features go to Microsoft web site.It is important to remember that for using C# 10 we need to install in our system .net 6. We start opening VS 2022, we create a new Console Application project called… Read More »

Category: C# Tags:

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:

Asynchronous Programming – 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 »

Asynchronous Programming – 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: