53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using Blazorise;
|
|
using Blazorise.Bootstrap;
|
|
using Blazorise.Icons.FontAwesome;
|
|
using BuchhaltungBlazor.Data;
|
|
|
|
// using Microsoft.EntityFrameworkCore;
|
|
|
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
// string connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
|
|
// builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlite(connectionString));
|
|
// builder.Services.AddDatabaseDeveloperPageExceptionFilter();
|
|
// builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true).AddEntityFrameworkStores<ApplicationDbContext>();
|
|
builder.Services.AddRazorPages();
|
|
builder.Services.AddServerSideBlazor();
|
|
// builder.Services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<IdentityUser>>();
|
|
// builder.Services.AddSingleton<GenericController>();
|
|
|
|
builder.Services.AddScoped<BookingDb>();
|
|
|
|
builder.Services.AddBlazorise(options => { options.Immediate = true; }).AddBootstrapProviders().AddBootstrapComponents().AddFontAwesomeIcons();
|
|
// .AddMaterialProviders().AddMaterialIcons();
|
|
builder.Services.AddOptions();
|
|
|
|
builder.WebHost.UseWebRoot("wwwroot");
|
|
builder.WebHost.UseStaticWebAssets();
|
|
|
|
WebApplication app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment()) {
|
|
app.UseMigrationsEndPoint();
|
|
}
|
|
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();
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
app.MapBlazorHub();
|
|
app.MapFallbackToPage("/_Host");
|
|
|
|
app.Run(); |