From 3abdcf8a7da197f826d46664bccef4cacad80f3c Mon Sep 17 00:00:00 2001 From: Daniel Hindrikes Date: Mon, 25 Nov 2024 20:23:15 +0100 Subject: [PATCH] .NET 9 --- .github/workflows/main.yml | 15 ++++++--------- .github/workflows/release.yml | 7 +++---- src/TinyMvvm.Maui.sln | 5 +++-- src/TinyMvvm.Maui/TinyMvvm.Maui.csproj | 2 +- src/TinyMvvm.Sample/Services/CityService.cs | 8 +++----- src/TinyMvvm.Sample/TinyMvvm.Sample.csproj | 6 +++--- src/TinyMvvm.Sample/ViewModels/MainViewModel.cs | 7 +++---- 7 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cda9e5c..3fdaa5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,12 @@ name: CI -# Controls when the action will run. +# Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] - - + branches: [main] jobs: # This workflow contains a single job called "build" @@ -21,15 +19,14 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' + dotnet-version: "8.0.x" - uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' - + dotnet-version: "9.0.x" + - name: Install maui run: dotnet workload install maui - - name: Run the Cake script uses: cake-build/cake-action@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fd25a7..b064bb9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,17 +10,16 @@ jobs: # The type of runner that the job will run on runs-on: macos-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v3 with: - dotnet-version: '7.0.x' + dotnet-version: "8.0.x" - uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' - + dotnet-version: "9.0.x" + - name: Install maui run: dotnet workload install maui diff --git a/src/TinyMvvm.Maui.sln b/src/TinyMvvm.Maui.sln index fff514a..1abc7e9 100644 --- a/src/TinyMvvm.Maui.sln +++ b/src/TinyMvvm.Maui.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 25.0.1703.0 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35514.174 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMvvm.Maui", "TinyMvvm.Maui\TinyMvvm.Maui.csproj", "{1E75EB2D-80A6-42E1-A581-DEA1BA7A7A8A}" EndProject @@ -19,6 +19,7 @@ Global {1E75EB2D-80A6-42E1-A581-DEA1BA7A7A8A}.Release|Any CPU.Build.0 = Release|Any CPU {A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A905BFB6-61AA-4422-B8C4-0E142A44FB8B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection diff --git a/src/TinyMvvm.Maui/TinyMvvm.Maui.csproj b/src/TinyMvvm.Maui/TinyMvvm.Maui.csproj index b058f86..e08cb92 100644 --- a/src/TinyMvvm.Maui/TinyMvvm.Maui.csproj +++ b/src/TinyMvvm.Maui/TinyMvvm.Maui.csproj @@ -1,7 +1,7 @@ - net7.0;net8.0 + net8.0;net9.0 enable enable true diff --git a/src/TinyMvvm.Sample/Services/CityService.cs b/src/TinyMvvm.Sample/Services/CityService.cs index 4565c27..9f12b62 100644 --- a/src/TinyMvvm.Sample/Services/CityService.cs +++ b/src/TinyMvvm.Sample/Services/CityService.cs @@ -1,6 +1,4 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; +using System.Text.Json; using TinyMvvm.Sample.Models; namespace TinyMvvm.Sample.Services; @@ -28,7 +26,7 @@ public async Task Get(string city) var cities = await Load(); - var result = cities.Single(x => x.Name == lowerText); + var result = cities.Single(x => x.Name.ToLower() == lowerText); return result; } @@ -40,7 +38,7 @@ public Task> GetAll() private async Task> Load() { - if(cities != null) + if (cities != null) { return cities; } diff --git a/src/TinyMvvm.Sample/TinyMvvm.Sample.csproj b/src/TinyMvvm.Sample/TinyMvvm.Sample.csproj index 6bf0080..5c3f23d 100644 --- a/src/TinyMvvm.Sample/TinyMvvm.Sample.csproj +++ b/src/TinyMvvm.Sample/TinyMvvm.Sample.csproj @@ -1,8 +1,8 @@  - net8.0-android;net8.0-ios;net8.0-maccatalyst - $(TargetFrameworks);net8.0-windows10.0.19041.0 + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 Exe @@ -36,7 +36,7 @@ latestmajor - + false diff --git a/src/TinyMvvm.Sample/ViewModels/MainViewModel.cs b/src/TinyMvvm.Sample/ViewModels/MainViewModel.cs index 16a579f..a5d467a 100644 --- a/src/TinyMvvm.Sample/ViewModels/MainViewModel.cs +++ b/src/TinyMvvm.Sample/ViewModels/MainViewModel.cs @@ -1,8 +1,7 @@ -using System; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; using System.Collections.ObjectModel; using System.Windows.Input; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; using TinyMvvm.Sample.Models; using TinyMvvm.Sample.Services; @@ -47,7 +46,7 @@ public MainViewModel(ICityService cityService) private ICommand show; public ICommand Show => show ??= new RelayCommand(async (city) => { - await Navigation.NavigateTo($"{nameof(DetailsViewModel)}", city.Name); + await Navigation.NavigateTo($"{nameof(DetailsViewModel)}", city); }); [ObservableProperty]