OK you can only register context in the ApplicationStart, and OnContextCreating is called from the EntityDataSource on the page when IT creates a context base on the MetaModel. You could change the Connection String in the OnContextCreating event. I have
not tried this but I woudl think it's worth a look.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
All-Star
17916 Points
5681 Posts
MVP
Re: Issue: Connect to different database based on QueryString parameter using DynamicData
Jan 09, 2014 04:38 PM|sjnaughton|LINK
OK you can only register context in the ApplicationStart, and OnContextCreating is called from the EntityDataSource on the page when IT creates a context base on the MetaModel. You could change the Connection String in the OnContextCreating event. I have not tried this but I woudl think it's worth a look.
Always seeking an elegant solution.