Design pattern question

beantownace

Active member
Joined
Feb 15, 2019
Messages
26
Programming Experience
5-10
Good morning gurus.

I have a question in regard to what this structure would be considered as far as design pattern.

Main API Project
- Controllers
- Worker/Manager Classes (handle the business logic) call service layer

Service Layer
- Service classes - routes to data layer

Data Layer
- Contains Data Caches and DB Context for DB calls

I still see this as a repository pattern approach however usually there would be a unit of work as well. Curious if this could be considering a different pattern approach.

Thanks for any input.
 
If you're talking about EF when you say "DB Context" then yes, that basically is the repository pattern. Microsoft have specifically stated that they recommend that you don't create your own repositories and unit of work when using EF because the DbContext basically is the unit of work and each DbSet it exposes basically is a repository.
 
Back
Top Bottom