It was not obvious how this feature works. adding a custom IStorageInitializer before calling UseCap is not working as the registration will get overwritten. This is not the case for the MySQL Initializer as this was already using the TryAddSingleton functionality
Issue(s) addressed:
435
Changes:
Calling TryAddSingleton when registering IStorageInitializer
Affected components:
InMemoryCapOptionsExtensions
MongoDBCapOptionsExtensions
PostgreSqlCapOptionsExtensions
SqlServerCapOptionsExtensions
Additional notes (optional):
I noticed that setting a custom IStorageInitializer
Checklist:
[x] I have tested my changes locally
[ ] I have added necessary documentation (if applicable)
[ ] I have updated the relevant tests (if applicable)
[x] My changes follow the project's code style guidelines
as a temporary workaround you can override registration
After
options.UseMongoDB
do
services.RemoveAll<IStorageInitializer>(); services.AddSingleton<IStorageInitializer, CustomStorageInitializer>();
Description:
It was not obvious how this feature works. adding a custom IStorageInitializer before calling UseCap is not working as the registration will get overwritten. This is not the case for the MySQL Initializer as this was already using the TryAddSingleton functionality
Issue(s) addressed:
435
Changes:
Affected components:
Additional notes (optional):
I noticed that setting a custom IStorageInitializer
Checklist: