コード例 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            IoCConfig.Inicializar();

            ConfigurarIoCAdicional();

            IoCConfig.ConstrutorContainer.Populate(services);

            return(new AutofacServiceProvider(IoCConfig.ConstrutorContainer.Build()));
        }
コード例 #2
0
        public static void ConfigureContainer(ContainerBuilder builder)
        {
            builder.RegisterType <ConfiguracoesAplicacao>().As <ConfiguracoesAplicacaoAbstrato>().InstancePerLifetimeScope();

            IoCConfig.Inicializar(builder);
        }