public IServiceProvider ConfigureServices(IServiceCollection services) { #region [MVC Register] //services.Configure<CookiePolicyOptions>(options => // { // options.CheckConsentNeeded = context => true; // options.MinimumSameSitePolicy = SameSiteMode.None; // }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddScoped <IViewRenderService, ViewRenderService>(); services.AddSession(); #endregion [MVC Register] #region [Configuration Register] var configuration = new ConfigurationHelper(); Configuration.Bind("Configuration", configuration); services.AddSingleton(configuration); #endregion [Configuration Register] #region [Autofac] var builder = new ContainerBuilder(); builder.Populate(services); AutofacBootstrapper.BuilderContainer(builder); this.ApplicationContainer = AutofacBootstrapper.GetContainer(); return(new AutofacServiceProvider(this.ApplicationContainer)); #endregion [Autofac] }