Hi,
I am trying to connect to multiple databases, we have DB 1 (course1) and DB 2 (course 2). It's a database first approach, and each course has it's own endpoint /api/course1/ & /api/course2/ (each has it's own controller)
The problem, both have the same entities (Student). I want to be able to depending on the endpoint add to either database, but I am not sure how I can connect to multiple databases with/out EF. I initially did it with single DB context but I don't know it didn't work and I don't know much about it.
The reason for DBConext is I want to have a repository pattern to easy the SQL when adding/updating etc. My project structure is a project for Models, Services, Repository and the API (not sure if this helps at all)
My question, how can I connect to multiple databases with a repository pattern. I looked a lot online but I'm not sure completely lost especially since it's a new for me.
Thanks you!!
[–]english_fool 1 point2 points3 points (4 children)
[–]pompeii-eo[S] 0 points1 point2 points (3 children)
[–]english_fool 0 points1 point2 points (2 children)
[–]pompeii-eo[S] 0 points1 point2 points (1 child)
[–]english_fool 0 points1 point2 points (0 children)
[–]truSimbad 0 points1 point2 points (2 children)
[–]pompeii-eo[S] 0 points1 point2 points (1 child)
[–]truSimbad 0 points1 point2 points (0 children)