Skip to content

Commit

Permalink
[ksqlDB.RestApi.Client]: updated Blazor sample to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfabian committed Jan 4, 2024
1 parent a984feb commit d040afa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion Samples/Blazor.Sample/Blazor.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>df205641-c0bc-4548-b48b-9a0a25941283</UserSecretsId>
Expand Down
16 changes: 8 additions & 8 deletions Samples/Blazor.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Blazor.Sample.Components;
using Blazor.Sample.Data;
using Blazor.Sample.Extensions.Autofac;
using Blazor.Sample.Extensions.DependencyInjection;
Expand All @@ -11,10 +12,10 @@
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
builder.Configuration.AddEnvironmentVariables();


// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

builder.Services.AddHostedService<IoTSimulatorService>();

builder.Services.ConfigureServices(builder.Configuration);
Expand All @@ -33,19 +34,18 @@
}
else
{
app.UseExceptionHandler("/Error");
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// 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.UseAntiforgery();

app.UseRouting();

app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();

await TryMigrateDatabaseAsync(app);

Expand Down
2 changes: 1 addition & 1 deletion Samples/Blazor.Sample/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.AspNetCore": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
Expand Down
4 changes: 2 additions & 2 deletions Samples/Blazor.Sample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.AspNetCore": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
}

0 comments on commit d040afa

Please sign in to comment.