Hello,
In which layer of the project should I add this code block? My structure is as follows:
I tried TestBase, Application and Domain, but I got the same result.
MyTestBaseModule
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpTestBaseModule),
typeof(AbpAuthorizationModule),
typeof(MyDomainModule)
)]
public class MyTestBaseModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysAllowAuthorization();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
SeedTestData(context);
}
private static void SeedTestData(ApplicationInitializationContext context)
{
AsyncHelper.RunSync(async () =>
{
using (var scope = context.ServiceProvider.CreateScope())
{
await scope.ServiceProvider
.GetRequiredService\<IDataSeeder>()
.SeedAsync();
}
});
}
}
**MyDomainTestModule**
[DependsOn(
typeof(MyEntityFrameworkCoreTestModule)
)]
public class MyDomainTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
}
}
**MyApplicationTestModule**
[DependsOn(
typeof(MyApplicationModule),
typeof(MyDomainTestModule)
)]
public class MyApplicationTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var builder = new ConfigurationBuilder();
Configure\<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
context.Services.AddAlwaysDisableUnitOfWorkTransaction();
}
}
Thank you, Gizem
Hello maliming, Is there any update about situation of this issue ?
Thank you. Gizem
Thank you maliming. I'll close the issue. Have a nice day.
Hi Again, I just shared my new template project with you. ( sender: ozdemir.gizem@siemens.com)
Thank you for your time.
Hi,
Thank you. I get it.
Regards.
Hi liangshiwei,
Thx for your answer, I have tried IOptions and IOptionsSnapshot also. We can update value, but connections is not refreshed or updated with new hostname. Am i missing something ?
Regards. Mehmet
thank you for your support @maliming. We solved it.