mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-06 06:43:47 +00:00
Initial commit
This commit is contained in:
parent
1d9d051759
commit
9656378279
557 changed files with 182300 additions and 0 deletions
36
vscode/PracticalApps/Northwind.BlazorServer/Program.cs
Normal file
36
vscode/PracticalApps/Northwind.BlazorServer/Program.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Northwind.BlazorServer.Data; // WeatherForecastService
|
||||
using Packt.Shared; // AddNorthwindContext extension method
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddServerSideBlazor();
|
||||
builder.Services.AddSingleton<WeatherForecastService>();
|
||||
|
||||
builder.Services.AddNorthwindContext();
|
||||
|
||||
builder.Services.AddTransient<INorthwindService, NorthwindService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
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.MapBlazorHub();
|
||||
app.MapFallbackToPage("/_Host");
|
||||
|
||||
app.Run();
|
||||
Loading…
Add table
Add a link
Reference in a new issue