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

More by Md. Saddam Hossain

View profile