Should you use the Repository Pattern? With CQRS, Yes and No!
The repository pattern is polarizing. Some developers swear you should always use it to abstract data access logic while others think it’s unnecessary if you’re using an ORM. So should you use it? My answer is Yes and No! If you’re applying CQRS and Vertical Slice Architecture you’ll likely want a repository to build up Aggregates. However, for a Query, you may want to just get the data you need rather than an entire aggregate (or collection of aggregates) to build a view model. YouTube Check out my YouTube channel where I post all kinds of content that accompanies my posts including… Read More »Should you use the Repository Pattern? With CQRS, Yes and No!