コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PropertyViewerContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app
            .UseHttpsRedirection()
            .UseRouting()
            .UseCors()
            .UseAuthorization()
            .UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            if (env.IsDevelopment())
            {
                context.Database.Migrate();
            }
        }
コード例 #2
0
 public PropertyRepository(IConfiguration configuration, PropertyViewerContext context)
 {
     _httpClient.BaseAddress = new Uri(configuration["DataSourceUrl"]);
     _context = context;
 }