コード例 #1
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="boxOfficeDbContext"></param>
 /// <param name="uriService"></param>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 protected GlController(WebBoxOfficeDbContext boxOfficeDbContext, IUriService uriService, ILogger <T> logger, UserManager <WebBoxOfficeUser> userManager)
 {
     BoxOfficeDbContext = boxOfficeDbContext;
     UriService         = uriService;
     Logger             = logger;
     UserManager        = userManager;
 }
コード例 #2
0
 /// <summary>
 /// ScheduleController
 /// </summary>
 /// <param name="boxOfficeDbContext"></param>
 /// <param name="uriService"></param>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 public ScheduleController(WebBoxOfficeDbContext boxOfficeDbContext, IUriService uriService, ILogger <Schedule> logger, UserManager <WebBoxOfficeUser> userManager) : base(boxOfficeDbContext, uriService, logger, userManager)
 {
 }
コード例 #3
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="boxOfficeDbContext"></param>
 /// <param name="uriService"></param>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 public SpectaclesLinksController(WebBoxOfficeDbContext boxOfficeDbContext, IUriService uriService, ILogger <SpectaclesLinks> logger, UserManager <WebBoxOfficeUser> userManager) : base(boxOfficeDbContext, uriService, logger, userManager)
 {
 }
コード例 #4
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="boxOfficeDbContext"></param>
 /// <param name="uriService"></param>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 public TicketController(WebBoxOfficeDbContext boxOfficeDbContext, IUriService uriService, ILogger <Ticket> logger, UserManager <WebBoxOfficeUser> userManager) : base(boxOfficeDbContext, uriService, logger, userManager)
 {
 }
コード例 #5
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="env"></param>
        /// <param name="logger"></param>
        /// <param name="identityDbContext"></param>
        /// <param name="boxOfficeDbContext"></param>
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger <Startup> logger,
                              WebBoxOfficeIdentityDbContext identityDbContext, WebBoxOfficeDbContext boxOfficeDbContext)
        {
            if (!((RelationalDatabaseCreator)identityDbContext.Database.GetService <IDatabaseCreator>()).Exists())
            {
                logger.LogInformation("Identity Database not found, will create new...");
                identityDbContext.Database.EnsureCreated();
            }

            if (!((RelationalDatabaseCreator)boxOfficeDbContext.Database.GetService <IDatabaseCreator>()).Exists())
            {
                logger.LogInformation("Database not found, will create new...");
                boxOfficeDbContext.Database.EnsureCreated();
                new AddNewDbRecords(boxOfficeDbContext).AddNewRecords();
            }
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "WebBoxOffice API v1");
            });
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            if (!env.IsDevelopment())
            {
                app.UseSpaStaticFiles();
            }

            app.UseRouting();

            app.UseAuthentication();
            app.UseIdentityServer();
            app.UseAuthorization();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });

            app.UseSpa(spa =>
            {
                // To learn more about options for serving an Angular SPA from ASP.NET Core,
                // see https://go.microsoft.com/fwlink/?linkid=864501

                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
コード例 #6
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="boxOfficeDbContext"></param>
 /// <param name="uriService"></param>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 public CustomerController(WebBoxOfficeDbContext boxOfficeDbContext, IUriService uriService, ILogger <Customer> logger, UserManager <WebBoxOfficeUser> userManager) : base(boxOfficeDbContext, uriService, logger, userManager)
 {
 }