Skip to main content
  1. Tags/

Clean-Architecture

Adding .NET Aspire to an Existing Clean Architecture Project

Deep Dive · Dec 20, 2025 · 10 min read
The infrastructure overhead in microservices projects is real. Setting up databases, wiring service discovery, getting distributed tracing working, managing connection strings across environments—this work hits before you’ve written a line of business logic. On more than one project, I’ve watched the first sprint disappear into Docker Compose files and appsettings drift.
Adding .NET Aspire to an Existing Clean Architecture Project

.NET Architecture at Scale: Visual Guide to Modern Design Patterns

Deep Dive · Jul 5, 2025 · 46 min read
.NET Architecture at Scale: Visual Guide to Modern Design Patterns # ⚡ Performance Note: This article contains 16 comprehensive patterns with visual diagrams. For faster loading, consider bookmarking specific sections or using the “Find in Page” (Ctrl+F) feature to jump to relevant patterns.
.NET Architecture at Scale: Visual Guide to Modern Design Patterns

Validating Inputs with FluentValidation

Deep Dive · Dec 1, 2024 · 6 min read
Introduction # In this article, we will explore how to implement input validation in the Contact Management Application using FluentValidation. FluentValidation is a robust .NET library that facilitates the creation of flexible and extensible validation rules for your models. By integrating seamlessly with ASP.NET Core, it allows you to maintain clean separation between validation logic and business logic, adhering to the principles of Clean Architecture.
Validating Inputs with FluentValidation

Using Dapper for Data Access and Repository Pattern

Deep Dive · Dec 1, 2024 · 9 min read
Introduction # In this article, we will explore how the Contact Management Application integrates Dapper for efficient data access. Dapper is a micro-ORM (Object-Relational Mapper) that excels in performance by directly interacting with SQL. We will focus on how Dapper is utilized within the Repository Pattern to ensure clean, maintainable, and efficient access to the database. Additionally, we will explore how Dapper works in tandem with the Unit of Work pattern to manage transactions.
Using Dapper for Data Access and Repository Pattern

Unit of Work Pattern and Its Role in Managing Transactions

Deep Dive · Dec 1, 2024 · 6 min read
Introduction # The Unit of Work pattern is a critical component in maintaining data consistency within applications that perform multiple database operations as part of a single logical transaction. In Clean Architecture, this pattern works alongside the Repository pattern to manage database transactions effectively, ensuring that changes are saved atomically and consistently. This article explores how the Unit of Work pattern is implemented in the Contact Management Application to coordinate related operations and maintain data integrity.
Unit of Work Pattern and Its Role in Managing Transactions

Seeding Initial Data Using Docker Compose and SQL Scripts

Deep Dive · Dec 1, 2024 · 7 min read
Introduction # When setting up a new application, especially in development and testing environments, having a consistent and repeatable process for initializing your database with essential data is crucial. This article explores how the Contact Management Application uses Docker Compose and SQL scripts to automate the seeding process, ensuring that every instance of the application starts with the necessary baseline data.
Seeding Initial Data Using Docker Compose and SQL Scripts

Implementing AutoMapper for DTO Mapping with Audit Details

Deep Dive · Dec 1, 2024 · 7 min read
AutoMapper is a powerful object-object mapper that simplifies the transformation between data models. In Clean Architecture, it plays a vital role in maintaining a clear separation of concerns between layers. By automating mapping and handling fields like CreatedBy, CreatedOn, UpdatedBy, and UpdatedOn, AutoMapper reduces boilerplate code and ensures consistency.
Implementing AutoMapper for DTO Mapping with Audit Details

Implementing Activity Logging with Custom Attributes

Deep Dive · Dec 1, 2024 · 6 min read
Introduction # Tracking user activities is crucial for security, auditing, and troubleshooting in any application. This article explores how to implement activity logging in the Contact Management Application using custom .NET attributes and action filters. This approach seamlessly integrates logging into the application without cluttering controllers or business logic with repetitive logging code.
Implementing Activity Logging with Custom Attributes

Handling Authorization and Role-Based Access Control (RBAC)

Deep Dive · Dec 1, 2024 · 19 min read
Introduction # Role-Based Access Control (RBAC) is a critical component of secure application design that restricts access to resources based on user roles and permissions. This article explores how the Contact Management Application implements a flexible and maintainable RBAC system that covers both the backend API and frontend Angular application, integrating with JWT authentication to secure endpoints and UI elements while maintaining the separation of concerns that Clean Architecture demands.
Handling Authorization and Role-Based Access Control (RBAC)

Error Handling and Exception Management in the API

Deep Dive · Dec 1, 2024 · 7 min read
Introduction # Effective error handling is critical for building robust APIs that can gracefully manage unexpected situations. In Clean Architecture, consistent error responses and proper exception management improve the user experience and simplify debugging. This article explores how the Contact Management Application implements centralized error handling through middleware, custom exceptions, and standardized API responses.
Error Handling and Exception Management in the API

Dockerizing the .NET Core API, Angular and MS SQL Server

Deep Dive · Dec 1, 2024 · 10 min read
Introduction # Docker has revolutionized application deployment by enabling consistent environments across development, testing, and production. In Clean Architecture, containerization aligns perfectly with the separation of concerns principle, allowing each layer to be independently developed and deployed. This article explores how to Dockerize the Contact Management Application’s .NET Core API and MS SQL Server database.
Dockerizing the .NET Core API, Angular and MS SQL Server

Dependency Injection Setup Across Layers

Deep Dive · Dec 1, 2024 · 6 min read
Introduction # Dependency Injection (DI) is a key design pattern in Clean Architecture that facilitates loose coupling between components. By injecting dependencies rather than hard-coding them, we create more maintainable, testable code where components can be easily swapped or mocked. This article explores how to implement DI across different architectural layers in the Contact Management Application.
Dependency Injection Setup Across Layers