コード例 #1
0
ファイル: Startup.cs プロジェクト: MalikWhitfield/YotesAPI2
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, YoteContext yoteContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                //yoteContext.Database.Migrate();
            }

            app.UseHttpsRedirection();

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
                c.RoutePrefix = string.Empty;
            });

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
コード例 #2
0
ファイル: YoteService.cs プロジェクト: maybeinit/EmoteYote
 public YoteService(YoteContext dbContext)
 {
     _dbContext = dbContext;
 }