Skip to content

Commit 04b8706

Browse files
Merge pull request #464 from TransactionProcessing/task/#463_net9_upgrade
Upgrade to .NET 9.0 and enhance result handling
2 parents 229fe7e + ac4d58a commit 04b8706

36 files changed

Lines changed: 366 additions & 244 deletions

File tree

.github/workflows/buildwindowsimage.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2.3.4
17+
18+
- name: Install NET 9
19+
uses: actions/setup-dotnet@v4.0.1
20+
with:
21+
dotnet-version: '9.0.x'
1722

1823
- name: Get the version
1924
id: get_version

.github/workflows/createrelease.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2.3.4
1717

18+
- name: Install NET 9
19+
uses: actions/setup-dotnet@v4.0.1
20+
with:
21+
dotnet-version: '9.0.x'
22+
1823
- name: Get the version
1924
id: get_version
2025
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

.github/workflows/nightlybuild.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v2.3.4
18+
19+
- name: Install NET 9
20+
uses: actions/setup-dotnet@v4.0.1
21+
with:
22+
dotnet-version: '9.0.x'
1823

1924
- name: Set Up Variables
2025
run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

.github/workflows/pullrequest.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v2.3.4
1818

19+
- name: Install NET 9
20+
uses: actions/setup-dotnet@v4.0.1
21+
with:
22+
dotnet-version: '9.0.x'
23+
1924
- name: Echo vars
2025
run: |
2126
echo "CI is > ${CI}"

.github/workflows/pushtomain.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jobs:
1818
- uses: actions/checkout@v2.3.4
1919
with:
2020
fetch-depth: 0
21+
22+
- name: Install NET 9
23+
uses: actions/setup-dotnet@v4.0.1
24+
with:
25+
dotnet-version: '9.0.x'
2126

2227
- name: Restore Nuget Packages
2328
run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

FIleProcessor.Models/FIleProcessor.Models.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<DebugType>None</DebugType>
66
</PropertyGroup>
77

FileProcessor.BusinessLogic.Tests/FileProcessingManagerTests.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ public async Task FileProcessingManager_GetFileImportLogs_NoMerchantId_ImportLog
8181
new Mock<IAggregateRepository<FileAggregate, DomainEvent>>();
8282
FileProcessorManager manager = new FileProcessorManager(fileProfiles, contextFactory.Object, modelFactory, fileAggregateRepository.Object);
8383

84-
List<FileImportLog> importLogs = await manager.GetFileImportLogs(TestData.EstateId, TestData.ImportLogStartDate, TestData.ImportLogEndDate, null, CancellationToken.None);
85-
84+
Result<List<FileImportLog>> getFileImportLogsResult = await manager.GetFileImportLogs(TestData.EstateId, TestData.ImportLogStartDate, TestData.ImportLogEndDate, null, CancellationToken.None);
85+
getFileImportLogsResult.IsSuccess.ShouldBeTrue();
86+
List<FileImportLog> importLogs = getFileImportLogsResult.Data;
8687
this.VerifyImportLogs(TestData.FileImportLogs,importLogs);
8788
}
8889

@@ -164,7 +165,10 @@ public async Task FileProcessingManager_GetFileImportLog_WithMerchantId_ImportLo
164165
[Fact]
165166
public async Task FileProcessingManager_GetFile_FileReturned()
166167
{
167-
List<FileProfile> fileProfiles = new List<FileProfile>();
168+
List<FileProfile> fileProfiles = new List<FileProfile>
169+
{
170+
TestData.FileProfile
171+
};
168172
var context = await this.GetContext(Guid.NewGuid().ToString("N"));
169173
var contextFactory = this.CreateMockContextFactory();
170174
contextFactory.Setup(c => c.GetContext(It.IsAny<Guid>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(context);
@@ -181,7 +185,6 @@ public async Task FileProcessingManager_GetFile_FileReturned()
181185
this.VerifyFile(TestData.GetFileAggregateWithLines(), fileDetails);
182186
fileDetails.Data.MerchantName.ShouldBeNull();
183187
fileDetails.Data.UserEmailAddress.ShouldBeNull();
184-
fileDetails.Data.FileProfileName.ShouldBeNull();
185188
}
186189

187190
[Fact]
@@ -206,7 +209,10 @@ public async Task FileProcessingManager_GetFile_FileAggregateFailed_ErrorReturne
206209
[Fact]
207210
public async Task FileProcessingManager_GetFile_FileReturnedWithMerchantName()
208211
{
209-
List<FileProfile> fileProfiles = new List<FileProfile>();
212+
List<FileProfile> fileProfiles = new List<FileProfile>
213+
{
214+
TestData.FileProfile
215+
};
210216
var context = await this.GetContext(Guid.NewGuid().ToString("N"));
211217
context.Merchants.Add(new Merchant
212218
{
@@ -235,7 +241,10 @@ public async Task FileProcessingManager_GetFile_FileReturnedWithMerchantName()
235241
[Fact]
236242
public async Task FileProcessingManager_GetFile_FileReturnedWithUserEmailAddress()
237243
{
238-
List<FileProfile> fileProfiles = new List<FileProfile>();
244+
List<FileProfile> fileProfiles = new List<FileProfile>
245+
{
246+
TestData.FileProfile
247+
};
239248
var context = await this.GetContext(Guid.NewGuid().ToString("N"));
240249
context.EstateSecurityUsers.Add(new EstateSecurityUser()
241250
{
@@ -380,19 +389,19 @@ private void VerifyImportLog(TransactionProcessor.Database.Entities.FileImportLo
380389
}
381390
}
382391

383-
private Mock<Shared.EntityFramework.IDbContextFactory<EstateManagementGenericContext>> CreateMockContextFactory()
392+
private Mock<Shared.EntityFramework.IDbContextFactory<EstateManagementContext>> CreateMockContextFactory()
384393
{
385-
return new Mock<Shared.EntityFramework.IDbContextFactory<EstateManagementGenericContext>>();
394+
return new Mock<Shared.EntityFramework.IDbContextFactory<EstateManagementContext>>();
386395
}
387396

388-
private async Task<EstateManagementGenericContext> GetContext(String databaseName)
397+
private async Task<EstateManagementContext> GetContext(String databaseName)
389398
{
390-
EstateManagementGenericContext context = null;
399+
EstateManagementContext context = null;
391400

392-
DbContextOptionsBuilder<EstateManagementGenericContext> builder = new DbContextOptionsBuilder<EstateManagementGenericContext>()
401+
DbContextOptionsBuilder<EstateManagementContext> builder = new DbContextOptionsBuilder<EstateManagementContext>()
393402
.UseInMemoryDatabase(databaseName)
394403
.ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning));
395-
context = new EstateManagementSqlServerContext(builder.Options);
404+
context = new EstateManagementContext(builder.Options);
396405

397406
return context;
398407
}

FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<DebugType>None</DebugType>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.14" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.14" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.5" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
1313
<PackageReference Include="Moq" Version="4.20.72" />
1414
<PackageReference Include="Shouldly" Version="4.3.0" />
15-
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.0.11" />
15+
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.0.14" />
1616
<PackageReference Include="xunit" Version="2.9.3" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
17+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
<PrivateAssets>all</PrivateAssets>
2020
</PackageReference>

FileProcessor.BusinessLogic/Common/ConfigurationReaderConnectionStringRepository.cs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Linq;
44
using System.Text;
55
using System.Threading.Tasks;
6-
using MySqlConnector;
76

87
namespace FileProcessor.BusinessLogic.Common
98
{
@@ -41,29 +40,17 @@ public async Task<String> GetConnectionString(String externalIdentifier,
4140
String connectionString = string.Empty;
4241
String databaseName = string.Empty;
4342

44-
String databaseEngine = ConfigurationReader.GetValue("AppSettings", "DatabaseEngine");
45-
4643
databaseName = $"{connectionStringIdentifier}{externalIdentifier}";
4744
connectionString = ConfigurationReader.GetConnectionString(connectionStringIdentifier);
4845

4946
DbConnectionStringBuilder builder = null;
5047

51-
if (databaseEngine == "MySql")
52-
{
53-
builder = new MySqlConnectionStringBuilder(connectionString)
54-
{
55-
Database = databaseName
56-
};
57-
}
58-
else
48+
// Default to SQL Server
49+
builder = new SqlConnectionStringBuilder(connectionString)
5950
{
60-
// Default to SQL Server
61-
builder = new SqlConnectionStringBuilder(connectionString)
62-
{
63-
InitialCatalog = databaseName
64-
};
65-
}
66-
51+
InitialCatalog = databaseName
52+
};
53+
6754
return builder.ToString();
6855
}
6956

FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.14" />
9-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
10-
<PackageReference Include="SecurityService.Client" Version="2025.1.1" />
11-
<PackageReference Include="Shared" Version="2025.3.1" />
12-
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.3.1" />
13-
<PackageReference Include="MediatR" Version="12.4.1" />
14-
<PackageReference Include="Shared.EventStore" Version="2025.3.1" />
15-
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
16-
<PackageReference Include="TransactionProcessor.Client" Version="2025.2.10" />
17-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.14" />
18-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.14" />
19-
<PackageReference Include="TransactionProcessor.Database" Version="2025.2.10" />
8+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
9+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
10+
<PackageReference Include="SecurityService.Client" Version="2025.5.2-build82" />
11+
<PackageReference Include="Shared" Version="2025.6.2" />
12+
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.6.2" />
13+
<PackageReference Include="MediatR" Version="12.5.0" />
14+
<PackageReference Include="Shared.EventStore" Version="2025.6.2" />
15+
<PackageReference Include="System.IO.Abstractions" Version="22.0.14" />
16+
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.2-build186" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
19+
<PackageReference Include="TransactionProcessor.Database" Version="2025.5.2-build186" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

0 commit comments

Comments
 (0)