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

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseSwagger();

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

            app.UseKledex().EnsureDomainDbCreated();

            //dbContext.Database.EnsureDeleted();
            dbContext.Database.EnsureCreated();
        }
コード例 #2
0
 public GetAthleteHandler(AthlosDbContext db)
 {
     _db = db;
 }
コード例 #3
0
 public GetTrainingPlansForAthleteHandler(AthlosDbContext db)
 {
     _db = db;
 }
コード例 #4
0
 public AthleteRegisteredHandler(AthlosDbContext db)
 {
     _db = db;
 }
コード例 #5
0
 public TrainingPlanCreatedHandler(AthlosDbContext db)
 {
     _db = db;
 }