Md. Saddam Hossain's profile

Production Ready EF Core CRUD in Layer Architecture

Production Ready EF Core CRUD in Layer Architecture
𝐂𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐭𝐥𝐲 𝐁𝐮𝐢𝐥𝐝 𝐏𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧-𝐑𝐞𝐚𝐝𝐲 𝐂𝐑𝐔𝐃 𝐰𝐢𝐭𝐡 𝐄𝐅 𝐂𝐨𝐫𝐞 𝐢𝐧 𝐍-𝐋𝐚𝐲𝐞𝐫 𝐀𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐞
I believe the project is suitable for beginners to advanced levels who want to develop an ASP.NET Core Web API project with N-Layer architecture.

Controllers are very thin, resulting in a neat and clean appearance. API versioning with CORS is implemented. Balancing Cross-Cutting Concerns in the project has been achieved. The Global Error Handling middleware has been implemented nicely. Logging Source Generator for High-Performance Logging and Structured Logging in ASP.NET Core With Serilog has been implemented. In the API layer, caching has been introduced. You can use Ardalis Guard Clauses or ErrorOr, but in these projects, I implement custom guard clauses that are fully customizable. Dependency injection is utilized throughout. Health checks are integrated so we can check the health condition of the project. The project also includes an audit trail. Here, we have EF Core code-first migration.

We have robust Architecture tests for the full N-Layer architecture and unit tests. Unit tests cover 100% test coverage, including the controller and service layers. You can learn how to write architecture and unit tests effectively by examining the project. I have written over 80 unit tests, which may seem extensive, but it's because of the approach I take, which makes learning and understanding easy.

With the introduction of MsBuild, we now have the capability to manage all property settings and more within a single file, which can be placed in the root directory of our solution alongside our solution file. This file (Directory.Build.props) will automatically apply to all projects defined in the solution.

Dependency management is a fundamental aspect of NuGet. While managing dependencies for a single project may be straightforward, it becomes increasingly challenging as multi-project solutions grow in size and complexity. In scenarios where common dependencies are shared across numerous projects, leveraging NuGet's centralized package management features allows for streamlined management from a single location. I achieve this through a centralized NuGet package system using Directory.Packages.props.

Here is the link to see more details about the project: https://saddamhossain.net/essentials-collection
Production Ready EF Core CRUD in Layer Architecture
Published:

Owner

Production Ready EF Core CRUD in Layer Architecture

Published: