public AccountsController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IConfiguration configuration, spinedbContext db) { _userManager = userManager; _signInManager = signInManager; _configuration = configuration; notificationsController = new NotificationsController(_configuration); this.db = db; }
public UsersController(spinedbContext db, SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager, IHostingEnvironment env, IConfiguration configuration) { this.db = db; _signInManager = signInManager; _userManager = userManager; _env = env; _configuration = configuration; fileController = new FileUploadController(db, _env); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, spinedbContext dbContext, IServiceProvider serviceProvider) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider( Path.Combine(env.WebRootPath, "Uploads")), RequestPath = "/api/uploads" }); } // Enable the use of static files app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider( Path.Combine(env.ContentRootPath, "wwwroot/Uploads")), RequestPath = "/api/uploads" }); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); app.UseAuthentication(); // Allow CORS from any domain app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); app.UseMvc(); //Create the Application Roles CreateApplicationRoles(serviceProvider).Wait(); // Create the tables dbContext.Database.EnsureCreated(); }
public GenresController(spinedbContext db) { this.db = db; }
public ContactsController(spinedbContext db) { this.db = db; }
public FileUploadController(spinedbContext db, IHostingEnvironment env) { this.db = db; this.env = env; }
public DocumentsController(spinedbContext db, IHostingEnvironment env) { this.db = db; fileController = new FileUploadController(db, env); }