'Repository pattern with generic database context

In the generic repository described here, a single database context internal SchoolContext context; is used. I want to build a generic repository but because I am using multiple databases (multiple connection strings), I do not want to hard code the database context. Is there a way of doing this that does not require re-writing the same methods for a different database context?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source