Skip to content

ASP.NET Core Enterprise Applications

Jeferson Almeida edited this page Oct 6, 2024 · 5 revisions

Welcome to the aspnet-core-enterprise-application wiki!

Developing project for large-scale, low-latency applications


DDD Domain-driven design (DDD) is a software development methodology that focuses on understanding and modeling a business domain to improve the quality of software. DDD is particularly useful for complex domains where a lot of logic needs to be organized.

Here are some key aspects of DDD:

  • Domain models DDD helps developers create domain models, which are software abstractions that encapsulate complex business logic.

  • Bounded contexts DDD divides large systems into bounded contexts, each with its own model.

  • Collaboration DDD encourages collaboration between technical and domain experts to refine a conceptual model.

  • Code structure The structure and language of software code should match the business domain.

  • Benefits DDD can lead to better application balance and cleaner, more reliable code.

_The name DDD comes from a 2003 book by Eric Evans that introduced the notion of classifying objects into entities, value objects, and service objects.


IAggregateRoot In .NET, the IAggregateRoot interface is used to indicate that a class entity is an aggregate root:

  • What is an aggregate root? In Domain-Driven Design (DDD), an aggregate root is an entity that acts as a focal point for a cluster of related entities and value objects.

  • What is the IAggregateRoot interface? The IAggregateRoot interface is an empty interface, also known as a marker interface, that's used to indicate that a class entity is an aggregate root.

  • Why use the IAggregateRoot interface? The IAggregateRoot interface is a simple way to mark a class, especially when the interface might be evolving.

  • What does an aggregate root do? An aggregate root's main objective is to maintain consistency. For example, if an Order entity has a collection of OrderItem entities, the Order is the aggregate root. The aggregate root class must keep control and consistency of any update operation against its child entities.


Delegating Handlers Delegating handlers are cousins of asp.net core middleware. Lets talk a bit about middlewares, this will help us understand delegating handler easy.

A middleware resides in the asp.net core application that accepts http requests. The Http request flows into the first middleware and if it wants passes on the request to the next. Until, there is a middleware the creates a response and the response flows back from the middleware that generated the response up until the first middleware. Finally the response is sent back to the client that actually made the http request over the network.

Delegating handlers are similar to middlewares but on the client side. So, if you are making a http request using the httpClient you can leverage delegating handlers.


Refit The Refit client is a library for .NET that simplifies the consumption of REST APIs (HTTP Client):

  • Purpose Refit provides interfaces that abstract communication with HTTP services, allowing for the writing of clean code with low coupling and using few lines of code.

-Features Refit reduces the amount of code required to call APIs by:

  • Eliminating the need to manually construct HTTP requests and handle responses
  • Providing automatic serialization and deserialization of data Compatibility Refit is compatible with:
  • .Net Framework 4.6.1
  • . Net Standard
  • . Net 5
  • UWP
  • Xamarin
  • Desktop . NET 4.6.1
  • Blazor
  • Uno Platform

SDK requirements Refit 6 requires:

  • Visual Studio 16.8 or higher
  • The .NET SDK 5.0.100 or higher

NuGet references Refit v6 and later does not support the old packages.config format for NuGet references. You must migrate to PackageReference to use Refit v6 and later. Refit was inspired by the popular Java library, Retrofit.

Clone this wiki locally