Tagged: .Net

Dependency Injection Setup Across Layers 5

Dependency Injection Setup Across Layers

Introduction Dependency Injection (DI) is a key aspect of Clean Architecture, ensuring decoupling between layers while enabling seamless communication. In the Contact Management Application, the DI setup is structured into API, Application, and Infrastructure layers, with each layer...

Error Handling and Exception Management in the API 7

Error Handling and Exception Management in the API

Introduction In any well-architected API, managing errors effectively is critical for ensuring stability, security, and ease of use. In the Contact Management Application, we follow clean architecture principles to implement structured error handling, ensuring...

Implementing Activity Logging with Custom Attributes 8

Implementing Activity Logging with Custom Attributes

Introduction In any enterprise-level application, logging user actions is essential for both auditing and security purposes. The Contact Management Application leverages middleware and a custom ActivityLogAttribute to implement detailed activity logging. This approach ensures...

Best Practices for Creating and Using DTOs in the API 5

Best Practices for Creating and Using DTOs in the API

Introduction In clean architecture, Data Transfer Objects (DTOs) play a vital role in decoupling the domain model from the external presentation layer, providing a clean and manageable way of interacting with external systems like...

Seeding Initial Data MS SQL 5

Seeding Initial Data Using Docker Compose and SQL Scripts

Introduction When developing an API, there are situations where it is important to populate the database with initial or sample data for testing and development purposes. In this article, we will discuss how to...