samedi 9 juillet 2022

Confusion over using generic repository in .NET Core 6

I'm developing services with a micro service architecture using .NET Core 6. I'm trying to follow clean architecture advice and have created 3 layers, Core (I put my use cases, repository interfaces, and my dto models), API layer, and infrastructure (connection with DB and implementation of repository interfaces).

The problem is the number of repositories is increasing, because I'm creating a separate repository for each different job, for example IStoreCarPricesRepository, IStoreCarSparePartRepository,..... I was thinking, would it not be wiser to have a generic repository and and just create a class to call it and do the jobless say you are getting different messages from different queues and was to store them in the respective tables?

As far as I searched for generic repository is kind of outdated, I would appreciate your comments

Aucun commentaire:

Enregistrer un commentaire