The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +772K…

Member-only story

Clean Architecture — ASP.NET Core API using Partitioned Repository Pattern with Azure Cosmos DB

Shawn Shi
The Startup
Published in
6 min readSep 20, 2020

--

UPDATE April 10, 2022: all projects in the GitHub repo have been upgraded to .NET 5.

Clean Architecture — Onion View (From Microsoft documentation)

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

--

--

The Startup
The Startup

Published in The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +772K followers.

Shawn Shi
Shawn Shi

Written by Shawn Shi

Senior Software Engineer at Microsoft. Ex-Machine Learning Engineer. When I am not building applications, I am playing with my kids or outside rock climbing!

Responses (4)