entity framework dynamic schema load

160 views Asked by At

I'm working on a database schema that involves two static sales agency that have the same database model.

For example: dbo.User becomes paris.User and toulouse.User

Our project works with Linq To SQL and we use sqlmetal to generate two map files one for the Paris agency and the other for Toulouse.

With active directory, we are able to detect where the user come from and by that, we choose the map file corresponding to his agency.

My question is:

Is there a way to do the same in Entity framework ?

if not, what can i do ? and what's the best solution that i should follow, while using Entity framework.

1

There are 1 answers

1
Vivek Shah On

You can have multiple dbcontext in entity framework so depending on your agency you can use the different dbcontext.