Open jrwpatterson opened 6 years ago
I think the registration call you're looking for in Simple Injector is RegisterSingleton
.
The code (completely untested) might look something like this:
ConfigurationConfigurator.RegisterConfigurationSettings()
.FromAssemblies(ThisAssembly)
.RegisterWithContainer(configSetting =>
container.RegisterSingleton(configSetting.GetType(), configSetting)
)
.DoYourThing();
Does that help?
Cool I might give it a goo this weekend
From: Andrew Harcourt notifications@github.com Sent: Friday, March 23, 2018 9:24:29 PM To: ConfigInjectorContributors/ConfigInjector Cc: jrwpatterson; Author Subject: Re: [ConfigInjectorContributors/ConfigInjector] Simple injector (#37)
I think the registration call you're looking for in Simple Injector is RegisterSingleton.
The code (completely untested) might look something like this:
ConfigurationConfigurator.RegisterConfigurationSettings() .FromAssemblies(ThisAssembly) .RegisterWithContainer(configSetting => container.RegisterSingleton(configSetting.GetType(), configSetting) ) .DoYourThing();
Does that help?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ConfigInjectorContributors/ConfigInjector/issues/37#issuecomment-375628944, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARSmONRc8CSw2_7p7_4NaDSmVTqe2ZSFks5thNttgaJpZM4S3_2q.
Any Idea how to use this with simple injector I'm racking my brain!