Skip to content

Commit f7046d7

Browse files
authored
feat: Sundown .NET 6 & .NET 7 (#97)
* feat: Sundown .NET 6 & .NET 7 * fix: Switched to `${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}`
1 parent b51f818 commit f7046d7

7 files changed

Lines changed: 13 additions & 18 deletions

File tree

.github/workflows/cicd.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ jobs:
2525
with:
2626
enableSonarQube: true
2727
dotnet-logging: ${{ inputs.dotnet-logging }}
28-
dotnet-version: |
29-
6.x
30-
7.x
31-
8.x
28+
dotnet-version: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
3229
solution: ./Extensions.Hosting.WinForms.sln
3330
runs-on-build: windows-latest
3431
runs-on-tests: windows-latest

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Import Project="$(DirEngineeringSettings)tests.build.props" Condition=" '$(IsTestableProject)' == 'true' " />
1111

1212
<PropertyGroup>
13-
<_TargetFrameworks>net6.0-windows;net7.0-windows;net8.0-windows</_TargetFrameworks>
13+
<_TargetFrameworks>net8.0-windows;net9.0-windows</_TargetFrameworks>
1414
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1515
</PropertyGroup>
1616

Directory.Packages.props

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
<ItemGroup>
1616
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
1717
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
18-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
19-
<PackageVersion Update="Microsoft.Extensions.Hosting" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net7.0-windows' " />
20-
<PackageVersion Update="Microsoft.Extensions.Hosting" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net6.0-windows' " />
21-
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
22-
<PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net7.0-windows' " />
23-
<PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net6.0-windows' " />
18+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
19+
<PackageVersion Update="Microsoft.Extensions.Hosting" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net8.0-windows' " />
20+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
21+
<PackageVersion Update="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" Condition=" '$(TargetFramework)' == 'net8.0-windows' " />
2422
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
2523
<PackageVersion Include="NetEvolve.Extensions.XUnit" Version="2.3.1" />
2624
<PackageVersion Include="NSubstitute" Version="5.3.0" />

src/NetEvolve.Extensions.Hosting.WinForms/IHostBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ public static HostApplicationBuilder UseWindowsForms<TApplicationContext>(
158158

159159
var services = contextFactory is null
160160
? builder.Services.AddSingleton<ApplicationContext, TApplicationContext>()
161-
: builder.Services.AddSingleton<ApplicationContext, TApplicationContext>(sp =>
162-
contextFactory.Invoke(sp)
161+
: builder.Services.AddSingleton<ApplicationContext, TApplicationContext>(
162+
contextFactory.Invoke
163163
);
164164

165165
_ = services

src/NetEvolve.Extensions.Hosting.WinForms/Internals/FormularProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public async ValueTask<T> GetFormularAsync<T>()
5858
try
5959
{
6060
return await synchronizationContext
61-
.InvokeAsync(() => serviceProvider.GetRequiredService<T>())!
61+
.InvokeAsync(serviceProvider.GetRequiredService<T>)!
6262
.ConfigureAwait(false);
6363
}
6464
finally

tests/NetEvolve.Extensions.Hosting.WinForms.Tests.Architecture/ProjectArchitecture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class ProjectArchitecture
99
{
1010
// TIP: load your architecture once at the start to maximize performance of your tests
1111
private static readonly Lazy<Architecture> _instance = new Lazy<Architecture>(
12-
() => LoadArchitecture(),
12+
LoadArchitecture,
1313
LazyThreadSafetyMode.PublicationOnly
1414
);
1515

tests/NetEvolve.Extensions.Hosting.WinForms.Tests.Unit/Internals/FormularProviderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void GetFormular_InvalidForm_ThrowsInvalidOperationException()
4343

4444
// Act / Assert
4545
_ = Assert.Throws<InvalidOperationException>(
46-
() => formularProvider.GetFormular<TestFormNotRegistered>()
46+
formularProvider.GetFormular<TestFormNotRegistered>
4747
);
4848
}
4949

@@ -117,7 +117,7 @@ public void GetScopedForm_InvalidForm_ThrowsInvalidOperationException()
117117

118118
// Act / Assert
119119
_ = Assert.Throws<InvalidOperationException>(
120-
() => formularProvider.GetScopedForm<TestFormNotRegistered>()
120+
formularProvider.GetScopedForm<TestFormNotRegistered>
121121
);
122122
}
123123

@@ -272,7 +272,7 @@ public void GetMainFormular_InvalidForm_ThrowsInvalidOperationException()
272272
using var formularProvider = new FormularProvider(serviceProvider, synchronizationContext);
273273

274274
// Act / Assert
275-
_ = Assert.Throws<InvalidOperationException>(() => formularProvider.GetMainFormular());
275+
_ = Assert.Throws<InvalidOperationException>(formularProvider.GetMainFormular);
276276
}
277277

278278
[Fact]

0 commit comments

Comments
 (0)