Skip to content

ASP.NET Core Enterprise Applications

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

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

Developing project for large-scale, low-latency applications


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.