Multiple Repository Data Contexts with my Repository Pattern
I recently needed to have links to multiple different database contexts within an application I was developing using StaticVoid.Core.Repository. I use ninject for all of my dependency injection and I though it might be useful to share how I managed to get the repository binding correctly to different versions of DbContext depending on the type requested. Below is a little extension method I wrote to deal with this problem:
This makes it quite tidy to link to multiple data contexts and means that anywhere in your app ninject will infer the data context for that type based on the namespace of the type.