コード例 #1
0
 public AccountService(ThirdPartyContext context)
 {
     _context = context;
 }
コード例 #2
0
 public UserService(ThirdPartyContext context)
 {
     _context = context;
 }
コード例 #3
0
ファイル: Startup.cs プロジェクト: guoxin-qiu/Bonbonniere_T
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ILoggerFactory loggerFactory, BonbonniereContext bonbonniereContext, ThirdPartyContext thirdPartyContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Add the authentication middleware to the pipeline
            app.UseAuthentication();

            app.UseCors("AllowSpecificOrigin");

            //app.UseBasicAuthenticationMiddleware();

            app.UseSwagger();

            app.UseSwaggerUI(sg =>
            {
                sg.SwaggerEndpoint($"/swagger/{_ApiVersion}/swagger.json", $"{_Project_Name} {_ApiVersion}");
                sg.ShowRequestHeaders();
            });

            //app.UseStaticFiles();
            //app.UseStatusCodePages();

            app.UseMvc();

            bonbonniereContext.Initialize();
            thirdPartyContext.Initialize();
        }