We are working on multi tenancy application where for each tenant we have Separate/individual database. We are using EF core dbcontext ,my question is :
1-Does dbcontext pooling works for this scenario
2-We are creating context in each request based on tenatid present in request ,so how we will achieve contextPooling ?
Thanks in Advance
I have achieved this by using SetConnectionString() method. I have created Middleware in which based on request client I am getting connection string and setting to Dbcontext using
_dbcontext.DataBase.CloseConnection()
_dbcontext.DataBase.SetConnectionString(conn);