Member-only story
Clean Architecture — ASP.NET Core API using Partitioned Repository Pattern with Azure Cosmos DB
Discussing a GitHub starter project to build a web API using Partitioned Repository Pattern with Azure Cosmos DB, ASP.NET Core, and Clean Architecture.
Published in
6 min readSep 20, 2020
UPDATE April 10, 2022: all projects in the GitHub repo have been upgraded to .NET 5.
This article describes the GitHub project that can be used as a starting point to work with:
- Clean Architecture (Onion Architecture)
- ASP.NET Core 3.1
- Azure Cosmos DB .NET SDK V3
- Repository Design Pattern
- Partition Key and Partitioned Repository
Popular features also supported in the project include:
- Cosmos DB database initial creation and data seeding
- Query data using Parameterized Query, LINQ and IQueryable, Specification Pattern in Cosmos DB
- REST API with OData support and Swagger UI
- MediatR Command/Query pattern
- MediatR pipeline behaviour for exception handling
- FluentValidation for validation