// This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            SettingsUtils.AttachConfiguration(Configuration);

            // See http://docs.autofac.org/en/latest/integration/aspnetcore.html#quick-start .
            // Add framework services.
            services.AddMvc();

            // Create the container builder.
            var builder = new ContainerBuilder();

            // Register dependencies, populate the services from
            // the collection, and build the container. If you want
            // to dispose of the container at the end of the app,
            // be sure to keep a reference to it as a property or field.
            builder.Populate(services);

            // register the alarm dependencies
            builder.RegisterModule(new AlarmModule());

            this.ApplicationContainer = builder.Build();

            // Create the IServiceProvider based on the container.
            return(new AutofacServiceProvider(this.ApplicationContainer));
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // .NET Core specific: Inject configurations to the static configuration provider.
            SettingsUtils.AttachConfiguration(Configuration);

            // Add framework services.
            services.AddMvc();
        }
Example #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            SettingsUtils.AttachConfiguration(Configuration);

            new ServicesConfigurator(Configuration, services).Configure();

            services.AddMvc();
            services.Configure <AppOption>(Configuration);
        }
Example #4
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     SettingsUtils.AttachConfiguration(Configuration);
     services.AddMvc();
 }