Beispiel #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();

            //using StructureMap;
            var container = new Container();

            // add connection string config section
            container.Configure(config =>
            {
                config.For <IConfigurationSection>()
                .Add(Configuration.GetSection(Common.Constants.ConnectionStrings))
                .Named(Common.Constants.ConnectionStrings);
            });

            // add APP extensions
            container.AddBusiness();

            container.Populate(services);

            return(container.GetInstance <IServiceProvider>());
        }