Skip to content

Commit

Permalink
feat(net8): make it compile
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Oct 12, 2023
1 parent 417f44e commit 6c32c28
Show file tree
Hide file tree
Showing 118 changed files with 2,436 additions and 1,849 deletions.
2 changes: 1 addition & 1 deletion apps/NewBlazor/Components/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
private int currentCount = 0;
private int currentCount;

private void IncrementCount()
{
Expand Down
2 changes: 1 addition & 1 deletion apps/NewBlazor/Components/Pages/Weather.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/weather"
@attribute [StreamRendering(true)]
@attribute [StreamRendering]

<PageTitle>Weather</PageTitle>

Expand Down
1 change: 1 addition & 0 deletions apps/NewBlazor/NewBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ProjectReference Include="..\..\src\Sitko.Core.Grpc.Server\Sitko.Core.Grpc.Server.csproj" />
<ProjectReference Include="..\..\src\Sitko.Core.Grpc\Sitko.Core.Grpc.csproj" />
<ProjectReference Include="..\..\src\Sitko.Core.Pdf\Sitko.Core.Pdf.csproj" />
<ProjectReference Include="..\..\src\Sitko.Core.Sentry\Sitko.Core.Sentry.csproj" />
<Protobuf Include="**/*.proto" GrpcServices="Both" AdditionalImportDirs="..\..\src\Sitko.Core.Grpc\Proto"/>
</ItemGroup>

Expand Down
8 changes: 5 additions & 3 deletions perf/Sitko.Core.App.Perf/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Localization;
using Sitko.Core.App.Localization;
using Sitko.Core.App.Tests;

namespace Sitko.Core.App.Perf;
Expand All @@ -23,8 +25,9 @@ public class LocalizationTest
[GlobalSetup]
public void GlobalSetup()
{
var application = new LocalizationTestApplication(Array.Empty<string>());
var host = application.GetHostBuilder().Build();
var builder = Host.CreateApplicationBuilder();
builder.AddJsonLocalization(options => options.AddDefaultResource<Default>());
var host = builder.Build();
factory = host.Services.GetService<IStringLocalizerFactory>();
type = typeof(LocalizationTests);
}
Expand Down Expand Up @@ -53,4 +56,3 @@ public void GlobalSetup()
[Benchmark]
public string DefaultInvariantFallback() => Localizer["DefaultBaz"];
}

2 changes: 1 addition & 1 deletion src/Sitko.Core.App.Web/IWebApplicationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface IWebApplicationModule<TModuleOptions> : IWebApplicationModule,
where TModuleOptions : class, new()
{
void ConfigureWebHost(IApplicationContext applicationContext, ConfigureWebHostBuilder webHostBuilder,
TModuleOptions valueTuple)
TModuleOptions options)
{
}
}
135 changes: 0 additions & 135 deletions src/Sitko.Core.App.Web/WebApplication.cs

This file was deleted.

12 changes: 6 additions & 6 deletions src/Sitko.Core.App.Web/WebApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace Sitko.Core.App.Web;

Expand All @@ -22,21 +23,20 @@ protected override void ConfigureHostBuilder<TModule, TModuleOptions>(Applicatio
if (module is TModule and IWebApplicationModule<TModuleOptions> webModule &&
options is TModuleOptions webModuleOptions)
{
webModule?.ConfigureWebHost(BootApplicationContext, webApplicationBuilder.WebHost, webModuleOptions);
webModule.ConfigureWebHost(BootApplicationContext, webApplicationBuilder.WebHost, webModuleOptions);
}
}
}
}

public static class WebApplicationExtensions
{
public static SitkoCoreApplicationBuilder AddSitkoCore(this WebApplicationBuilder builder) =>
builder.AddSitkoCore(Array.Empty<string>());

public static SitkoCoreApplicationBuilder AddSitkoCore(this WebApplicationBuilder builder, string[] args)
{
builder.Services.AddTransient<IStartupFilter, SitkoCoreWebStartupFilter>();
// if (builder.Builder is WebApplicationBuilder webApplicationBuilder)
// {
// webApplicationBuilder.WebHost.
// }
builder.Services.TryAddTransient<IStartupFilter, SitkoCoreWebStartupFilter>();
return new SitkoCoreWebApplicationBuilder(builder, args);
}

Expand Down
Loading

0 comments on commit 6c32c28

Please sign in to comment.