refactor: Address SonarCloud code smells

pull/63/head
Robert Dailey 3 years ago
parent 2572b15947
commit 19d41c27a4

@ -55,11 +55,6 @@ public static class CompositionRoot
builder.RegisterGeneric(typeof(ConfigurationLoader<>))
.WithProperty(new AutowiringParameter())
.As(typeof(IConfigurationLoader<>));
// note: Do not allow consumers to resolve IServiceConfiguration directly; if this gets cached
// they end up using the wrong configuration when multiple instances are used.
// builder.Register(c => c.Resolve<IConfigurationProvider>().ActiveConfiguration)
// .As<IServiceConfiguration>();
}
private static void CommandRegistrations(ContainerBuilder builder)
@ -69,6 +64,9 @@ public static class CompositionRoot
.Where(t => t.IsAssignableTo(typeof(ICommand)));
// Used to access the chosen command class. This is assigned from CliTypeActivator
//
// note: Do not allow consumers to resolve IServiceConfiguration directly; if this gets cached they end up using
// the wrong configuration when multiple instances are used.
builder.RegisterType<ActiveServiceCommandProvider>()
.As<IActiveServiceCommandProvider>()
.SingleInstance();

@ -13,8 +13,5 @@ public class MigrationAutofacModule : Module
// Migration Steps
builder.RegisterType<MigrateTrashYml>().As<IMigrationStep>();
builder.RegisterType<MigrateTrashUpdaterAppDataDir>().As<IMigrationStep>();
// Automatically register all migration steps
// builder.RegisterAssemblyTypes(typeof(MigrationAutofacModule).Assembly).AssignableTo<IMigrationStep>();
}
}

Loading…
Cancel
Save