entity framework - Breeze EFContextProvider per request and based on parameter? -


i have multi-tenant app in user can select "current company" after log in. there db per company model same, workflow same, , controller actions same....the user can switch companies while being logged in , actions need 'directed' proper db.

i know possible customize context creation in efcontextprovider<t> overriding createcontext() how pass info (parameter, e.g. companyid) allow me create context correct connection string?

is possible?

i find easiest way include tenant id in custom http header.

because tenant id changes during session, want create custom breeze ajax adapter (wrap 1 you're using now) sets header dynamically during implementation of ajax method.

on server fish header out of request.

make sure validating user , header on server


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -