コード例 #1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddDistributedMemoryCache();
     services.AddSession();
     services.AddControllersWithViews();
     services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
     .AddCookie();
     services.AddScoped <hmsDBContext>();
     BOServices.AddScoped(services);
 }
コード例 #2
0
ファイル: Startup.cs プロジェクト: Abdullah-onGit/hms
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDistributedMemoryCache();
            services.AddSession();
            services.AddControllersWithViews();
            services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
            .AddCookie();
            services.AddScoped <hmsDBContext>();
            BOServices.AddScoped(services);

            services.Configure <ForwardedHeadersOptions>(options =>
            {
                options.KnownProxies.Add(IPAddress.Parse("10.0.0.4"));
            });
        }