c# - How to change the schema on a dynamic per query basis? -


i want able pass name of schema of data layer methods, , somehow have entity framework change schema on per query basis.

is possible?

public class userrepository : genericrepository<....> {       public list<user> getusersbylocation(string schema, int locationid)     {         ....     } } 

on per call basis want able change schema ef query.

if want sql dml query multitenant shared schema data base per query basis

you have following things

  1. when creating schema, create user , set default schema schema
  2. store schema , username , password in dbo table master

if have above data can use same query data server changing connectionstring required db username , password


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -