You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/test/Volo.Abp.MultiTenancy.Appli.../Volo/Abp/MultiTenancy/AbpIdentityApplicationTestB...

31 lines
930 B

using System;
using Volo.Abp.MultiTenancy.EntityFrameworkCore;
using Volo.Abp.TestBase;
namespace Volo.Abp.MultiTenancy
{
public class AbpMultiTenancyApplicationTestBase : AbpIntegratedTest<AbpMultiTenancyApplicationTestModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
protected virtual void UsingDbContext(Action<IMultiTenancyDbContext> action)
{
using (var dbContext = GetRequiredService<IMultiTenancyDbContext>())
{
action.Invoke(dbContext);
}
}
protected virtual T UsingDbContext<T>(Func<IMultiTenancyDbContext, T> action)
{
using (var dbContext = GetRequiredService<IMultiTenancyDbContext>())
{
return action.Invoke(dbContext);
}
}
}
}