public void ConfigureContainer(ContainerBuilder builder) { var config = Configuration.Get <ScoutConfiguration>(); config.MongoConnectionString = Configuration.GetConnectionString("MongoDB"); builder.RegisterInstance <IScoutConfiguration>(config); builder.RegisterInstance <IScoutEncryption>(new ScoutEncryption(config)).SingleInstance(); ContainerLoader.LoadContainers(builder); }
static ContainerBuilder SetupIoc() { var builder = new ContainerBuilder(); var config = Configuration.Get <ScoutConfiguration>(); config.MongoConnectionString = Configuration.GetConnectionString("MongoDB"); var enc = new ScoutEncryption(config); builder.RegisterInstance <IScoutConfiguration>(config); builder.RegisterInstance <IScoutEncryption>(enc); ContainerLoader.LoadContainers(builder); return(builder); }