From 8a16658dfe319dbd3b72a2f0d14b0a8606ec2743 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Sun, 14 Dec 2025 19:51:36 +0100 Subject: [PATCH] Partially updated to .net 10 --- .gitlab-ci.yml | 4 ++-- global.json | 7 +++++++ src/Portfolio.Api/Portfolio.Api.csproj | 8 ++++---- src/Portfolio.Api/Program.cs | 20 +------------------- src/Portfolio.Host/Portfolio.Host.csproj | 8 ++++---- src/Portfolio.Shared/Portfolio.Shared.csproj | 14 +++++++------- src/Portfolio.Web/Portfolio.Web.csproj | 2 +- 7 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 global.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b92947..edb8da1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ variables: build: stage: build - image: mcr.microsoft.com/dotnet/sdk:9.0 + image: mcr.microsoft.com/dotnet/sdk:10.0 script: - dotnet restore - dotnet build --configuration Release --no-restore @@ -19,7 +19,7 @@ build: test: stage: test - image: mcr.microsoft.com/dotnet/sdk:9.0 + image: mcr.microsoft.com/dotnet/sdk:10.0 script: - dotnet test --verbosity normal dependencies: diff --git a/global.json b/global.json new file mode 100644 index 0000000..a11f48e --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "10.0.0", + "rollForward": "latestMajor", + "allowPrerelease": true + } +} \ No newline at end of file diff --git a/src/Portfolio.Api/Portfolio.Api.csproj b/src/Portfolio.Api/Portfolio.Api.csproj index bbdd1dd..c033bcd 100644 --- a/src/Portfolio.Api/Portfolio.Api.csproj +++ b/src/Portfolio.Api/Portfolio.Api.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/Portfolio.Api/Program.cs b/src/Portfolio.Api/Program.cs index d2b722c..a3bd274 100644 --- a/src/Portfolio.Api/Program.cs +++ b/src/Portfolio.Api/Program.cs @@ -1,4 +1,3 @@ -using HopFrame.Core.Config; using HopFrame.Web; using Portfolio.Api; using Portfolio.Api.Services; @@ -31,25 +30,8 @@ builder.Services.AddHopFrame(options => { options.DisplayUserInfo(false); options.AddDbContext(context => { context.Table(table => { - var langConfig = table.InnerConfig.Properties - .Single(prop => prop.Name == nameof(Project.Languages)); - - langConfig - .GetType()! - .GetProperty(nameof(PropertyConfig.IsRelation))! - .SetValue(langConfig, true); - - langConfig - .GetType()! - .GetProperty(nameof(PropertyConfig.IsEnumerable))! - .SetValue(langConfig, true); - - langConfig - .GetType()! - .GetProperty(nameof(PropertyConfig.IsRequired))! - .SetValue(langConfig, true); - table.Property(p => p.Languages) + .ForceRelation(isEnumerable: true) .FormatEach((l, _) => l.Name) .List(false); diff --git a/src/Portfolio.Host/Portfolio.Host.csproj b/src/Portfolio.Host/Portfolio.Host.csproj index 8868389..253ca60 100644 --- a/src/Portfolio.Host/Portfolio.Host.csproj +++ b/src/Portfolio.Host/Portfolio.Host.csproj @@ -4,7 +4,7 @@ Exe - net9.0 + net10.0 enable enable true @@ -12,9 +12,9 @@ - - - + + + diff --git a/src/Portfolio.Shared/Portfolio.Shared.csproj b/src/Portfolio.Shared/Portfolio.Shared.csproj index 6a8950a..1abf123 100644 --- a/src/Portfolio.Shared/Portfolio.Shared.csproj +++ b/src/Portfolio.Shared/Portfolio.Shared.csproj @@ -10,13 +10,13 @@ - - - - - - - + + + + + + + diff --git a/src/Portfolio.Web/Portfolio.Web.csproj b/src/Portfolio.Web/Portfolio.Web.csproj index 92326bb..1c4ae35 100644 --- a/src/Portfolio.Web/Portfolio.Web.csproj +++ b/src/Portfolio.Web/Portfolio.Web.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable Linux