diff --git a/.github/workflows/AnugToolsBackend.yml b/.github/workflows/AnugToolsBackend.yml index 06f21e1..5e351f4 100644 --- a/.github/workflows/AnugToolsBackend.yml +++ b/.github/workflows/AnugToolsBackend.yml @@ -7,9 +7,9 @@ env: AZURE_FUNCTIONAPP_NAME: AnugToolsBackend AZURE_FUNCTIONAPP_PACKAGE_PATH: AzureFunctionBackend\published CONFIGURATION: Release - DOTNET_CORE_VERSION: 8.0.x + DOTNET_CORE_VERSION: 9.0.x WORKING_DIRECTORY: AzureFunctionBackend - DOTNET_CORE_VERSION_INPROC: 8.0.x + DOTNET_CORE_VERSION_INPROC: 9.0.x jobs: build: runs-on: windows-latest diff --git a/.github/workflows/AnugToolsWebApp.yml b/.github/workflows/AnugToolsWebApp.yml index 503e873..032a0c4 100644 --- a/.github/workflows/AnugToolsWebApp.yml +++ b/.github/workflows/AnugToolsWebApp.yml @@ -7,7 +7,7 @@ env: AZURE_WEBAPP_NAME: AnugTools AZURE_WEBAPP_PACKAGE_PATH: BlazorApp\published CONFIGURATION: Release - DOTNET_CORE_VERSION: 8.0.x + DOTNET_CORE_VERSION: 9.0.x WORKING_DIRECTORY: BlazorApp jobs: build: diff --git a/AzureFunctionBackend/AzureFunctionBackend.csproj b/AzureFunctionBackend/AzureFunctionBackend.csproj index cb424f1..ded2e5b 100644 --- a/AzureFunctionBackend/AzureFunctionBackend.csproj +++ b/AzureFunctionBackend/AzureFunctionBackend.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 v4 Exe enable @@ -10,9 +10,9 @@ - + - + diff --git a/BlazorApp/BlazorApp.csproj b/BlazorApp/BlazorApp.csproj index 7e3002d..aa43c70 100644 --- a/BlazorApp/BlazorApp.csproj +++ b/BlazorApp/BlazorApp.csproj @@ -1,16 +1,16 @@  - net8.0 + net9.0 enable enable Debug;Release;DEBUG_REMOTE_BACKEND - - - + + + diff --git a/BlazorApp/Program.cs b/BlazorApp/Program.cs index 9362959..8157640 100644 --- a/BlazorApp/Program.cs +++ b/BlazorApp/Program.cs @@ -11,9 +11,8 @@ builder.Services.AddMudServices(); builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); -builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -await builder.Build().RunAsync(); +await builder.Build().RunAsync(); \ No newline at end of file diff --git a/BlazorApp/Services/ParticipationFileHandler.cs b/BlazorApp/Services/ParticipationFileHandler.cs deleted file mode 100644 index 3b7ad44..0000000 --- a/BlazorApp/Services/ParticipationFileHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -using BlazorApp.ExtensionMethods; -using Microsoft.AspNetCore.Components.Forms; -using SharedModels.Models.EventParticipants; - -namespace BlazorApp.Services; - - -public class ParticipationFileHandler -{ - public async Task> ParseFile(IBrowserFile file) - { - var result = new List(); - using var streamReader = new StreamReader(file.OpenReadStream()); - var fileContent = await streamReader.ReadToEndAsync(); - - var lines = fileContent.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); - - foreach (var line in lines.Skip(1)) - { - var lineParts = line.Split(new[] { "\t" }, StringSplitOptions.TrimEntries); - string name = lineParts[0]; - bool eventHost = !string.IsNullOrWhiteSpace(lineParts[2]); - string url = lineParts[8]; - - result.Add(new Participant(name, eventHost, url)); - } - - return result.OrderByWinnersThenName(); - - } -} \ No newline at end of file diff --git a/BlazorApp/Shared/MainLayout.razor b/BlazorApp/Shared/MainLayout.razor index ec09fc5..a43f7e4 100644 --- a/BlazorApp/Shared/MainLayout.razor +++ b/BlazorApp/Shared/MainLayout.razor @@ -10,6 +10,7 @@
+ Built using Blazor for .NET9 About ANUG Source Code on GitHub
diff --git a/BlazorApp/ViewModels/IndexViewModel.cs b/BlazorApp/ViewModels/IndexViewModel.cs index ee84666..fb5a762 100644 --- a/BlazorApp/ViewModels/IndexViewModel.cs +++ b/BlazorApp/ViewModels/IndexViewModel.cs @@ -1,5 +1,4 @@ using BlazorApp.Services; -using Microsoft.AspNetCore.Components.Forms; using SharedModels.Models.EventParticipants; using SharedModels.Models.GroupEvents; @@ -7,7 +6,6 @@ namespace BlazorApp.ViewModels; public class IndexViewModel { - private readonly ParticipationFileHandler _fileHandler; private readonly ParticipationWinnerSelector _participationWinnerSelector; private readonly BackendCaller _backendCaller; internal bool ShouldDrawWinnerBeDisabled => Participants == null; @@ -16,18 +14,12 @@ public class IndexViewModel internal IReadOnlyList? Events { get; private set; } public int NumerOfWinnerToSelect { get; set; } = 1; - public IndexViewModel(ParticipationFileHandler fileHandler, ParticipationWinnerSelector participationWinnerSelector, BackendCaller backendCaller) + public IndexViewModel(ParticipationWinnerSelector participationWinnerSelector, BackendCaller backendCaller) { - _fileHandler = fileHandler; _participationWinnerSelector = participationWinnerSelector; _backendCaller = backendCaller; } - internal async Task UploadFiles(IBrowserFile file) - { - Participants = await _fileHandler.ParseFile(file); - } - internal void ChooseWinner() { if (Participants == null) diff --git a/SharedModels/SharedModels.csproj b/SharedModels/SharedModels.csproj index 13cf622..198cb2f 100644 --- a/SharedModels/SharedModels.csproj +++ b/SharedModels/SharedModels.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable Debug;Release;DEBUG_REMOTE_BACKEND diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index d56e35f..80a29f2 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all