Code Maze Author

Ahsan Ullah

A Senior IT Developer with demonstrated proficiency (10+ years of experience) in supply chain management software projects of DSV A/S. Senior member of the core development team helping to meet growing business demands. Competent in the .NET platform and Angular applications. Other expertise includes skills in database development, designing algorithms, and developing interfaces from low-level responsive html tools to high-level middleware services.
Also find me here:

MY ARTICLES:

Mediator Design Pattern in C#

 In this article, we are going to talk about a popular design pattern, the Mediator Pattern. We will see how this pattern helps address some design problems and how to implement it in C#. [sc name="github"...

Template Method Design Pattern in C#

In this article, we will talk about a behavioral design pattern, the Template Method Pattern. We are going to see how this pattern helps deal with certain design problems and how to implement it in C#. [sc name="github"...

Bridge Design Pattern in C#

In this article, we are going to talk about a structural design pattern, the Bridge Pattern. We will discuss what problem this pattern solves and how to implement it in C#. [sc name="github"...

Proxy Design Pattern in C#

In this article, we are going to talk about a structural design pattern, the Proxy Pattern. We will discuss what problem this pattern solves and how to implement it in C#. [sc name="github"...

How to Serialize Exceptions as JSON in .NET

In this article, we will learn how to serialize exceptions as JSON in .NET. Good exception handling is one of the key aspects of a successful enterprise application. And when we talk about an API, it's important that we provide relevant failure details to consumer...

C# Deserialize JSON to Dynamic Object

Deserializing JSON into a dynamic object means skipping the class: we hand the JSON string to the serializer, ask for dynamic, and read properties by name at runtime. It is what we reach for when the payload's shape is unknown, changes often, or when we only want two...

Serialize Enum as String in C#: JsonStringEnumConverter

A C# enum serializes as a number by default. To get its name instead, System.Text.Json takes a JsonStringEnumConverter and Newtonsoft.Json takes a StringEnumConverter, applied to one property, one enum type, one serializer call, or the whole application....

Task.Factory.StartNew vs Task.Run in C#: The Difference

Use Task.Run. It is Task.Factory.StartNew with the two defaults almost every caller wants: TaskScheduler.Default instead of the current scheduler, and DenyChildAttach instead of allowing child tasks to attach, plus unwrapping for async delegates. Task.Factory.StartNew...

Convert DateTime to ISO 8601 String in C#

In this article, we are going to learn how to convert DateTime to ISO 8601 string in C#. There are various formats of ISO 8601 compliant date and time strings. We are going to build a console application and explore all these different formats.  To...