Zone of Development

by Damiano Abballe

Category: C#

Design Patterns – Command

From https://en.wikipedia.org/wiki/Command_pattern:“In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or trigger an event at a later time. This information includes the method name, the object that owns the method and values for the method parameters.”In a nutshell, we can use the Command Pattern to encapsulate […]

Read More

Azure – Queue with Service Bus

In this post, we will see how to send message in a queue using Azure Service Bus.But first of all, what is Azure Service Bus?“Microsoft Azure Service Bus is a fully managed enterprise message broker with message queues and publish-subscribe topics.If two applications want to communicate with each other with less dependency, then Azure service […]

Read More

C# – Events

In this post, we will see what an Event is and how we can use it.First of all, what is an Event?From Microsoft web site:“An event is a message sent by an object to signal the occurrence of an action. The action can be caused by user interaction, such as a button click, or it […]

Read More

C# – Dynamic Type

In this post, we will see what a Dynamic Type is and how to use it. Dynamic Type was introduced in C# 4.0 and it avoids compile-time type checking.It escapes type checking at compile-time and it resolves type a run time.A dynamic type variable is defined using the dynamic keyword.Let see some examples: DEFINING A […]

Read More

C# – Delegates

In this post, we will see what Delegates are and how to use them.First of all, what is a Delegate?From Microsoft web site: “A delegate is a type that safely encapsulates a method, similar to a function pointer in C and C++. Unlike C function pointers, delegates are object-oriented, type safe, and secure. The type of a […]

Read More

C# – TDD

In this post, we will see how to create a simple Console application (a calculator), using TDD.But first of all, what is TDD?From Wikipedia:“Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the code is improved […]

Read More

C# – Tips for String

In this post, we will see some interesting methods to use with String. HOW TO REVERSE A STRING HOW TO REVERSE THE ORDER OF WORDS IN A GIVEN STRING HOW TO COUNT THE OCCURRENCE OF EACH CHARACTER IN A STRING HOW TO FIND ALL POSSIBLE SUBSTRING OF A GIVEN STRING HOW TO REMOVE DUPLICATE CHARACTERS […]

Read More

C# – Logging in .NET Core

In this post, we will see how to add Logging in the project Api.Orders created in the post: Web API – How to use Polly library with Ocelot.Logging is a built-in feature of ASP.NET Core and .NET Core Work Services and it is provided as part of the Microsoft.Extensions.Logging library. For more information: Microsoft Web […]

Read More

C# – SOLID Principles

In this post, we will see what SOLID means and how to implement it using C#. What is SOLID?SOLID is a mnemonic acronym for five designers principles that help us to write software more understandable, easier to maintain, flexible and easier to extend.The five principles are:Single responsibility principleOpen/closed principleLiskov substitution principleInterface segregation principleDependency inversion principle  […]

Read More

C# – Using In Memory Database Provider for Unit Test

In this post, we will see how to use In-Memory Database Provider for Unit Test. We start creating a Blank Solution called ProjectDemo and then, we add a Class Library (.NET Core) called Entities where we will define a class called Retailer: [Retailer.cs] Now, we add another Class Library (.NET Core) called Data where we […]

Read More