Skip to content

Commit ce8e224

Browse files
authored
Merge pull request #31 from altasoft/upgrade-to-NET10
Upgrade to net10
2 parents 2d35925 + ae6ecb5 commit ce8e224

File tree

106 files changed

+3946
-1631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3946
-1631
lines changed

.github/workflows/build_nuget_dont_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
uses: actions/setup-dotnet@v1
1515
with:
1616
dotnet-version: |
17+
10.0.x
1718
9.0.x
1819
8.0.x
19-
7.0.x
2020
2121
- name: Extract version from tag
2222
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
uses: actions/setup-dotnet@v3
2727
with:
2828
dotnet-version: |
29+
10.0.x
2930
9.0.x
3031
8.0.x
31-
7.0.x
3232
3333
- name: Restore dependencies
3434
run: dotnet restore

.github/workflows/publish_nuget.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
uses: actions/setup-dotnet@v1
1616
with:
1717
dotnet-version: |
18+
10.0.x
1819
9.0.x
1920
8.0.x
20-
7.0.x
2121
2222
- name: Extract version from tag
2323
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV
@@ -36,3 +36,7 @@ jobs:
3636

3737
- name: Publish
3838
run: dotnet nuget push "nupkg/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
39+
40+
- name: Publish Symbols
41+
run: dotnet nuget push "nupkg/*.snupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
42+

AltaSoft.DomainPrimitives.sln

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.31903.59
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11217.181
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AltaSoft.DomainPrimitives.XmlDataTypes", "src\AltaSoft.DomainPrimitives.XmlDataTypes\AltaSoft.DomainPrimitives.XmlDataTypes.csproj", "{E5F41084-26EF-4BA5-A4F9-74105F550CB9}"
77
EndProject
@@ -12,6 +12,7 @@ EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BF9447CC-2D00-495A-A8C3-D4890EADB01B}"
1313
ProjectSection(SolutionItems) = preProject
1414
Directory.Build.props = Directory.Build.props
15+
Directory.Packages.props = Directory.Packages.props
1516
LICENSE.txt = LICENSE.txt
1617
README.md = README.md
1718
EndProjectSection
@@ -33,6 +34,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.S
3334
EndProject
3435
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.UnitTests", "tests\AltaSoft.DomainPrimitives.UnitTests\AltaSoft.DomainPrimitives.UnitTests.csproj", "{253F7819-7F69-9B49-8257-65A17B56DF55}"
3536
EndProject
37+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.OpenApiExtensions", "src\AltaSoft.DomainPrimitives.OpenApiExtensions\AltaSoft.DomainPrimitives.OpenApiExtensions.csproj", "{4705B432-D0D1-123B-3566-797F9C9323A7}"
38+
EndProject
3639
Global
3740
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3841
Debug|Any CPU = Debug|Any CPU
@@ -67,6 +70,10 @@ Global
6770
{253F7819-7F69-9B49-8257-65A17B56DF55}.Debug|Any CPU.Build.0 = Debug|Any CPU
6871
{253F7819-7F69-9B49-8257-65A17B56DF55}.Release|Any CPU.ActiveCfg = Release|Any CPU
6972
{253F7819-7F69-9B49-8257-65A17B56DF55}.Release|Any CPU.Build.0 = Release|Any CPU
73+
{4705B432-D0D1-123B-3566-797F9C9323A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74+
{4705B432-D0D1-123B-3566-797F9C9323A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
75+
{4705B432-D0D1-123B-3566-797F9C9323A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
76+
{4705B432-D0D1-123B-3566-797F9C9323A7}.Release|Any CPU.Build.0 = Release|Any CPU
7077
EndGlobalSection
7178
GlobalSection(SolutionProperties) = preSolution
7279
HideSolutionNode = FALSE

Directory.Build.props

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
11
<Project>
22
<PropertyGroup>
3+
<DefaultTargetFrameworks>net8.0;net9.0;net10.0</DefaultTargetFrameworks>
34
<OutputType>Library</OutputType>
45
<Nullable>enable</Nullable>
56
<LangVersion>Latest</LangVersion>
67
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<AnalysisLevel>latest</AnalysisLevel>
79

810
<Authors>ALTA Software llc.</Authors>
911
<Product>Domain Primitives</Product>
1012
<Company>ALTA Software llc.</Company>
1113
<Copyright>Copyright © 2024 ALTA Software llc.</Copyright>
12-
<Version>6.0.4</Version>
14+
<Version>7.0.0</Version>
1315
</PropertyGroup>
1416

17+
1518
<PropertyGroup>
1619
<PackageReadmeFile>README.md</PackageReadmeFile>
1720
<ProjectUrl>https://github.com/altasoft/DomainPrimitives</ProjectUrl>
21+
22+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1823
<RepositoryUrl>https://github.com/altasoft/DomainPrimitives</RepositoryUrl>
1924
<RepositoryType>git</RepositoryType>
2025
<PackageLicenseExpression>MIT</PackageLicenseExpression>
21-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
26+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2227
<PackageProjectUrl>https://github.com/altasoft/DomainPrimitives</PackageProjectUrl>
23-
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
28+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2429
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
25-
<EnableNETAnalyzers>True</EnableNETAnalyzers>
30+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
31+
2632
<PackageTags>ddd;domain;entity;dotnet-core;value-object;strongly-typed;</PackageTags>
2733
</PropertyGroup>
2834

35+
<PropertyGroup Condition=" '$(TF_BUILD)' == 'True' ">
36+
<DebugType>embedded</DebugType>
37+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
38+
<EmbedAllSources>false</EmbedAllSources>
39+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
40+
<Deterministic>true</Deterministic>
41+
</PropertyGroup>
42+
43+
2944
<ItemGroup>
3045
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
3146
</ItemGroup>

Directory.Packages.props

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!-- Enable Central Package Management -->
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
9+
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.1.0" />
10+
<PackageVersion Include="Microsoft.OpenApi" Version="1.3.1" />
11+
<PackageVersion Include="System.Collections.Frozen" Version="7.0.0" />
12+
<PackageVersion Include="Scalar.AspNetCore" Version="2.11.0" />
13+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
14+
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
15+
<PackageVersion Include="Verify.Xunit" Version="31.9.3" />
16+
<PackageVersion Include="xunit" Version="2.9.3" />
17+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
18+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
19+
</ItemGroup>
20+
21+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
22+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.22" />
23+
</ItemGroup>
24+
25+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
26+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.11" />
27+
</ItemGroup>
28+
29+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
30+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
31+
</ItemGroup>
32+
33+
</Project>

Examples/AltaSoft.DomainPrimitives.Demo.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.8.34330.188
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11217.181
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.Demo", "AltaSoft.DomainPrimitives.Demo\AltaSoft.DomainPrimitives.Demo.csproj", "{193DA3B4-7F2C-4EED-A7AF-9F69964B7B27}"
77
EndProject
@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives",
1313
EndProject
1414
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.SwaggerExtensions", "..\src\AltaSoft.DomainPrimitives.SwaggerExtensions\AltaSoft.DomainPrimitives.SwaggerExtensions.csproj", "{CAEE1818-F333-DF43-89BA-DEC9BD64E279}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltaSoft.DomainPrimitives.OpenApiExtensions", "..\src\AltaSoft.DomainPrimitives.OpenApiExtensions\AltaSoft.DomainPrimitives.OpenApiExtensions.csproj", "{069E8303-00AA-16AD-9DE1-FCD188DA59B1}"
17+
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1820
Debug|Any CPU = Debug|Any CPU
@@ -39,6 +41,10 @@ Global
3941
{CAEE1818-F333-DF43-89BA-DEC9BD64E279}.Debug|Any CPU.Build.0 = Debug|Any CPU
4042
{CAEE1818-F333-DF43-89BA-DEC9BD64E279}.Release|Any CPU.ActiveCfg = Release|Any CPU
4143
{CAEE1818-F333-DF43-89BA-DEC9BD64E279}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{069E8303-00AA-16AD-9DE1-FCD188DA59B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{069E8303-00AA-16AD-9DE1-FCD188DA59B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{069E8303-00AA-16AD-9DE1-FCD188DA59B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
47+
{069E8303-00AA-16AD-9DE1-FCD188DA59B1}.Release|Any CPU.Build.0 = Release|Any CPU
4248
EndGlobalSection
4349
GlobalSection(SolutionProperties) = preSolution
4450
HideSolutionNode = FALSE

Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<InvariantGlobalization>true</InvariantGlobalization>
@@ -10,14 +10,14 @@
1010
</PropertyGroup>
1111

1212

13-
<ItemGroup>
14-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
15-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
16-
</ItemGroup>
17-
18-
13+
<ItemGroup>
14+
<PackageReference Include="Scalar.AspNetCore" Version="1.1.1" />
15+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
16+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
17+
</ItemGroup>
1918

2019
<ItemGroup>
20+
<ProjectReference Include="..\..\src\AltaSoft.DomainPrimitives.OpenApiExtensions\AltaSoft.DomainPrimitives.OpenApiExtensions.csproj" />
2121
<ProjectReference Include="..\..\src\AltaSoft.DomainPrimitives.SwaggerExtensions\AltaSoft.DomainPrimitives.SwaggerExtensions.csproj" />
2222
<ProjectReference Include="..\DomainPrimitivesDemo\DomainPrimitivesDemo.csproj" />
2323
</ItemGroup>
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1+
using System.ComponentModel.DataAnnotations;
12
using DomainPrimitivesDemo;
23

34
namespace AltaSoft.DomainPrimitives.Demo;
4-
public sealed record Customer(CustomerId CustomerId, BirthDate BirthDate, CustomerName CustomerName, CustomerAddress CustomerAddress);
5+
// ReSharper disable InconsistentNaming
6+
public sealed record Customer(
7+
8+
[Required] CustomerId A_CustomerId, [Required] Guid A_CustomerIdDotNet,
9+
[Required] BirthDate B_BirthDate, [Required] DateOnly B_BirthDateDotNet,
10+
[Required] CustomerName C_CustomerName, [Required] string C_CustomerNameDotNet,
11+
[Required] PositiveAmount D_Amount, [Required] decimal D_AmountDotnet)
12+
{
13+
public CustomerAddress? CustomerAddress { get; set; } //ignore
14+
}
15+
16+
public sealed record CustomerNullable(
17+
CustomerId? A_CustomerId,
18+
Guid? A_CustomerIdDotNet,
19+
BirthDate? B_BirthDate,
20+
DateOnly? B_BirthDateDotNet,
21+
CustomerName? C_CustomerName,
22+
string? C_CustomerNameDotNet,
23+
PositiveAmount? D_Amount,
24+
decimal? D_AmountDotnet);
25+
26+
// ReSharper restore InconsistentNaming
527
public sealed record SetCustomerAddress(CustomerId CustomerId, CustomerAddress CustomerAddress);
28+
public sealed record SetCustomerAddressNullable(CustomerId CustomerId, CustomerAddress? CustomerAddress, PositiveAmount? Amount);
29+

Examples/AltaSoft.DomainPrimitives.Demo/CustomerService.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using DomainPrimitivesDemo;
21
using System.Collections.Concurrent;
2+
using DomainPrimitivesDemo;
33

44
namespace AltaSoft.DomainPrimitives.Demo;
55

@@ -14,7 +14,7 @@ public sealed class CustomerService
1414

1515
public Task AddCustomerAsync(Customer customer)
1616
{
17-
if (!_customers.TryAdd(customer.CustomerId, customer))
17+
if (!_customers.TryAdd(customer.A_CustomerId, customer))
1818
throw new BadHttpRequestException("Customer already exists");
1919

2020
return Task.CompletedTask;
@@ -30,4 +30,18 @@ public Task SetCustomerAddressAsync(SetCustomerAddress command)
3030
_customers[command.CustomerId] = customer;
3131
return Task.CompletedTask;
3232
}
33+
34+
public Task SetCustomerAddressNullableAsync(SetCustomerAddressNullable command)
35+
{
36+
if (command.CustomerAddress is null)
37+
return Task.CompletedTask;
38+
39+
if (!_customers.TryGetValue(command.CustomerId, out var customer))
40+
throw new BadHttpRequestException("Customer already exists");
41+
42+
customer = customer with { CustomerAddress = command.CustomerAddress };
43+
44+
_customers[command.CustomerId] = customer;
45+
return Task.CompletedTask;
46+
}
3347
}

0 commit comments

Comments
 (0)