0
chanchai-mwp created
- ABP Framework version: v2.9.0
- UI type: Angular
- Tiered (MVC) or Identity Server Seperated (Angular): yes
NetZero:
using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.Suppress))
{
using (var dbContext = _dbContextResolver.Resolve<Project1DemoDbContext>(connectionString, null))
{
}
}
AbpCommercial
How can we get dbcontext for tenants that have different connectionsstrings like NetZero.
4 Answer(s)
-
0
Hi,
Try:
using (CurrentTenant.Change(Guid.Parse("tenant id"))) { var dbContext= await _repository.GetDbContext(); }
See https://docs.abp.io/en/abp/latest/Entity-Framework-Core#access-to-the-ef-core-api
-
0
No luck. Couldn't find .GetDbContext() here.
-
0
Hi,
You need add
Volo.Abp.EntityframeworkCore
NuGet package to your project. -
0
I close this question, If you still have this question, Please reopen.