Beispiel #1
0
 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;
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
        // 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();
        }
Beispiel #4
0
 public GenresController(spinedbContext db)
 {
     this.db = db;
 }
Beispiel #5
0
 public ContactsController(spinedbContext db)
 {
     this.db = db;
 }
Beispiel #6
0
 public FileUploadController(spinedbContext db, IHostingEnvironment env)
 {
     this.db  = db;
     this.env = env;
 }
Beispiel #7
0
 public DocumentsController(spinedbContext db, IHostingEnvironment env)
 {
     this.db        = db;
     fileController = new FileUploadController(db, env);
 }