The repository pattern abstracts the data access layer from the business logic layer and presentation layers. The pattern can help you insulate your application from data store changes and facilitate automated unit testing.
This repository also provides a template that implements dependency injection and a generic template for the implementation of the repository pattern in a .NET 7 Core project using ASP.NET Razor Pages.