Configure Services
3 posts2 contributors
Articles about Configure Services

IExceptionHandler in ASP.NET Core 8
ASP.NET Core 8 introduces a new feature called IException Handler, providing a centralized way to handle exceptions in applications. This article explores what IExceptionHandler is and how to use it effectively.

Microservices Development Using CQRS Architectural Design Pattern in Microsoft Asp.net Core Web API
The Command Query Responsibility Segregation (CQRS) pattern is an architectural principle that separates the responsibility for handling commands (write operations that change state) from queries (read operations that retrieve state). It advocates having separate models for reading and writing data. Components of CQRS: Command: Represents an action that mutates the system's state. Query: Represents a request for data retrieval without changing the system's state. Command Handler: Responsible for executing commands and updating the system's state. Query Handler: Responsible for handling read requests and returning data in response to queries. Command Model: Contains the logic and rules necessary to process commands and update the data store. Query Model: Optimized for querying and presenting data to users, often involving denormalized or optimized data structures tailored for specific queries. Key Principles: Separation of Concerns: Splitting the responsibilities of reading and writing data helps in maintaining simpler, more focused models for each task. Performance Optimization: Enables independent scaling of read and write operations. The read model can be optimized for query performance without affecting the write model. Flexibility: Allows for different models to be used for reading and writing, which can cater to specific requirements and optimizations for each use case. Complex Domain Logic: Particularly beneficial in domains where read and write logic significantly differ, allowing tailored models for each type of operation. Benefits: Scalability: CQRS enables scaling read and write operations independently, optimizing performance. Flexibility and Optimization: Tailoring models for specific tasks allows for better optimization of the system. Complexity Management: Separating concerns can make the system easier to understand and maintain.

Efficient PDF Generation in ASP.NET Core Web API Using DinkToPdf
Generating PDF files in an ASP.NET Core Web API is a common requirement, and there are several libraries available to help with this task. In this example, I'll show you how to generate PDF files using the popular library called DinkToPdf, which is a .NET wrapper for the C library DinkToPdf. We'll also follow best practices for structuring your ASP.NET Core Web API project.
