コード例 #1
0
ファイル: Startup.cs プロジェクト: kaptast/formula1
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, FormulaDbContext db, IAuthService authService)
        {
            // Register the exception handling middleware
            app.UseMiddleware <ErrorHandlerMiddleware>();

            // Create the database tables if they haven't been created yet.
            db.Database.EnsureCreated();

            app.UseHttpsRedirection();

            app.UseCors();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            // Register test user
            authService.Register(new ViewModels.Models.UserViewModel {
                UserName = "******", Password = "******"
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
コード例 #2
0
ファイル: TeamRepository.cs プロジェクト: kaptast/formula1
 public TeamRepository(FormulaDbContext db)
     : base(db)
 {
 }
コード例 #3
0
ファイル: Repository.cs プロジェクト: kaptast/formula1
 public Repository(FormulaDbContext db)
 {
     this._dbContext = db;
 }