C#C
C#3y ago
sabaisabai

❔ blazor wasm 6 databases

Hello guys I have a project
in blazor and each dbcontext database in a different class library (repository pattern) I have to make simple queries based on variable which indicates what database to choose.

My plan is just simply put in each class library the same repository with interface and almost same implementation of the methods.
Then in my service get all repositories from 6db I can distinguish them by proper syntax in using and do switch statement...
I guess this is not optimal as I'm repeating myself should I maybe make abstract class? Or write generic method which gonna take different database and query them?
Was this page helpful?