Nope. Still the default connection string points to the default one...
Both AbpZeroDbMigrator instance and TestAbpZeroDbMigrator instance contain the same default database connection string. I assume this shouldn't be the case.
Configuration.ReplaceService<IConnectionStringResolver, MyDbPerTenantConnectionStringResolver>(); line doesn't seem to have any affect. I tried put the line in .EntityFrameworkCode module PreInitialize method and also tried it in Migrator module but still no luck.
In .EntityFrameworkCore there is already Default module one as below
Configuration.ReplaceService<IConnectionStringResolver, DefaultDbConnectionStringResolver>();
here is well _connectionStringResolver always points to default database connection string.
I started doubting that Migrator can be used to apply migration to multiple db context.. ?
thanks :)
I tried this but the instance cannot be created with the following error. Not sure how I should register this in Migrator project.
Message "Can't create component 'Project.Migrator.MultiTenantMigrateExecuter' as it has dependencies to be satisfied.\r\n\r\n'Project.Migrator.MultiTenantMigrateExecuter' is waiting for the following dependencies:\r\n- Service 'Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator 1[[Project.EntityFrameworkCore.APLBillingDbContext, Project.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.\r\n" string
I have followed the same pattern and created SecondDBMigrator class as below:
public class SecondDBMigrator : AbpZeroDbMigrator<SecondDBContext>
{
public SecondDBMigrator(
IUnitOfWorkManager unitOfWorkManager,
IDbPerTenantConnectionStringResolver connectionStringResolver,
IDbContextResolver dbContextResolver) :
base(
unitOfWorkManager,
connectionStringResolver,
dbContextResolver)
{
}
}
```
With this I don't get exexption but when I look at instance of the migrator connection string in debug mode I see the default database connection string registered instead of second database.
Ok I did a bit more investigation on this and I think i found what causing the issue. I guess it is a bug.
What I did is to disable all other languages( including englis-en) but en-GB. As we do not want to use localization. This is causing the message. As soon as I enable english (en) then I get the same error message with you.
Maybe this should be another question but is there any other place we should disable the localization and just make the default en-GB?
it-s en-GB.
Thanks I managed to install the nuget package.
Thanks for coming back.
We use angular + asp net core.
Somehow the message we get contains square brackets. I think this indicates that the message is also localized.
However, we add those keys in the localization xml files we still don't get the message you get in the screenshot. Any idea on that?
And thanks for the Fluent Validation. I think this would be the way to go. However, the nuget package does not seem to install. I get the following message.
And I assume this would work which project this should be installed? .Core or better in .Application?
Regards,