Implementing SOLID Web API using ASP.NET Core
The following article shows how to implementing SOLID Web API using ASP.NET Core. The projects use Generic repository pattern to perform CRUD operations, and XUnit as test runner.
Our solution will contain three key namespace:
- Data access: it will implement information about the domain model and the relationship between entities. It will also contain the information about data context;
- Domain Logic: it will implement the repositories and services used by our web APIs;
- API: it will implement controllers and middlewares to manage incoming requests;
Here is a brief schema of the project structure:
The key parts of the project are convered by unit tests or integration tests.