예제 #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, AdCampaignContext dbContext)
        {
            dbContext.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseRouting();

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

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
예제 #2
0
 public ApplicationRepository(AdCampaignContext context) => _context = context;
예제 #3
0
 public UserService(AdCampaignContext context, IPasswordHasherService passwordHasherService)
 {
     _context = context;
     _passwordHasherService = passwordHasherService;
 }
예제 #4
0
 public AuthenticationService(AdCampaignContext db, IPasswordHasher <User> passwordHasher)
 {
     _db             = db;
     _passwordHasher = passwordHasher;
 }
예제 #5
0
 public AdvertRepository(AdCampaignContext context) => _context = context;
 public AdvertStatisticRepository(AdCampaignContext context)
 {
     _context = context;
 }
예제 #7
0
 public FileRepository(AdCampaignContext db) => _db = db;