32 lines
941 B
C#
32 lines
941 B
C#
using BlazorApp1.Components;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using BlazorApp1.Data;
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
builder.Services.AddDbContext<BlazorApp1Context>(options =>
|
|
options.UseNpgsql(builder.Configuration.GetConnectionString("BlazorApp1Context") ?? throw new InvalidOperationException("Connection string 'BlazorApp1Context' not found.")));
|
|
|
|
builder.Services.AddQuickGridEntityFrameworkAdapter();;
|
|
|
|
// Add services to the container.
|
|
builder.Services.AddRazorComponents()
|
|
.AddInteractiveServerComponents();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
}
|
|
|
|
app.UseStaticFiles();
|
|
app.UseAntiforgery();
|
|
|
|
app.MapRazorComponents<App>()
|
|
.AddInteractiveServerRenderMode();
|
|
|
|
app.Run();
|