示例#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, SpeakerDbContext context)
        {
            context.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // comment out for building Docker
            // uncomment for localhost

            // app.UseHttpsRedirection();

            app.UseRouting();

            app.UseCors("Policy");

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
示例#2
0
 public HomeController(Models.SpeakerDbContext context)
 {
     _Context = context;
 }
示例#3
0
 public SpeakerController(SpeakerDbContext context)
 {
     _context = context;
 }
示例#4
0
 public SpeakerRepository(SpeakerDbContext context)
 {
     _context  = context;
     _speakers = context.Speakers;
 }