Skip to content

Commit

Permalink
Upgrade to .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjdk committed Nov 17, 2024
1 parent aff8f52 commit 9cc438a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/AnugToolsBackend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/AnugToolsWebApp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions AzureFunctionBackend/AzureFunctionBackend.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -10,9 +10,9 @@
<ItemGroup>
<PackageReference Include="GraphQL.Client" Version="6.1.0" />
<PackageReference Include="GraphQL.Client.Serializer.SystemTextJson" Version="6.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SharedModels\SharedModels.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions BlazorApp/BlazorApp.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Configurations>Debug;Release;DEBUG_REMOTE_BACKEND</Configurations>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="7.6.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions BlazorApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
builder.Services.AddMudServices();

builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped<ParticipationFileHandler>();
builder.Services.AddScoped<ParticipationWinnerSelector>();
builder.Services.AddScoped<BackendCaller>();
builder.Services.AddScoped<IndexViewModel>();

await builder.Build().RunAsync();
await builder.Build().RunAsync();
31 changes: 0 additions & 31 deletions BlazorApp/Services/ParticipationFileHandler.cs

This file was deleted.

1 change: 1 addition & 0 deletions BlazorApp/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<main>
<div class="top-row px-4">
Built using Blazor for .NET9
<a href="https://www.meetup.com/anugdk/" target="_blank">About ANUG</a>
<a href="https://github.com/rwjdk/AnugTools" target="_blank">Source Code on GitHub</a>
</div>
Expand Down
10 changes: 1 addition & 9 deletions BlazorApp/ViewModels/IndexViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using BlazorApp.Services;
using Microsoft.AspNetCore.Components.Forms;
using SharedModels.Models.EventParticipants;
using SharedModels.Models.GroupEvents;

namespace BlazorApp.ViewModels;

public class IndexViewModel
{
private readonly ParticipationFileHandler _fileHandler;
private readonly ParticipationWinnerSelector _participationWinnerSelector;
private readonly BackendCaller _backendCaller;
internal bool ShouldDrawWinnerBeDisabled => Participants == null;
Expand All @@ -16,18 +14,12 @@ public class IndexViewModel
internal IReadOnlyList<Event>? 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)
Expand Down
2 changes: 1 addition & 1 deletion SharedModels/SharedModels.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;DEBUG_REMOTE_BACKEND</Configurations>
Expand Down
6 changes: 3 additions & 3 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 9cc438a

Please sign in to comment.