From 8e5c9cfffbcb6e29aa9656f0eee8b6b0a9daadbd Mon Sep 17 00:00:00 2001 From: Maxime Boulay Date: Sat, 19 Apr 2025 22:04:18 +0200 Subject: [PATCH] Update to .Net 8.0 --- GiecChallenge.sln | 36 ++++++++++++++++++++++ backend/GiecChallenge/GiecChallenge.csproj | 21 ++++++------- backend/GiecChallenge/Program.cs | 13 ++++++-- 3 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 GiecChallenge.sln diff --git a/GiecChallenge.sln b/GiecChallenge.sln new file mode 100644 index 0000000..7b4cff1 --- /dev/null +++ b/GiecChallenge.sln @@ -0,0 +1,36 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{1AE8ACA6-933B-BF2A-3671-3E2EAC007D16}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GiecChallenge.test", "backend\GiecChallenge.test\GiecChallenge.test.csproj", "{C8412919-3D57-575D-473B-36E8CDA0115A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GiecChallenge", "backend\GiecChallenge\GiecChallenge.csproj", "{0CF5412D-7A84-3574-BBBB-208984176879}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C8412919-3D57-575D-473B-36E8CDA0115A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8412919-3D57-575D-473B-36E8CDA0115A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8412919-3D57-575D-473B-36E8CDA0115A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8412919-3D57-575D-473B-36E8CDA0115A}.Release|Any CPU.Build.0 = Release|Any CPU + {0CF5412D-7A84-3574-BBBB-208984176879}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CF5412D-7A84-3574-BBBB-208984176879}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CF5412D-7A84-3574-BBBB-208984176879}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CF5412D-7A84-3574-BBBB-208984176879}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C8412919-3D57-575D-473B-36E8CDA0115A} = {1AE8ACA6-933B-BF2A-3671-3E2EAC007D16} + {0CF5412D-7A84-3574-BBBB-208984176879} = {1AE8ACA6-933B-BF2A-3671-3E2EAC007D16} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FC6F7857-3118-47F2-A18B-CED2FCE69936} + EndGlobalSection +EndGlobal diff --git a/backend/GiecChallenge/GiecChallenge.csproj b/backend/GiecChallenge/GiecChallenge.csproj index cb8f395..48609f3 100644 --- a/backend/GiecChallenge/GiecChallenge.csproj +++ b/backend/GiecChallenge/GiecChallenge.csproj @@ -1,30 +1,29 @@ - net7.0 + net8.0 enable enable - - + - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/backend/GiecChallenge/Program.cs b/backend/GiecChallenge/Program.cs index 9c6a8b8..614389b 100644 --- a/backend/GiecChallenge/Program.cs +++ b/backend/GiecChallenge/Program.cs @@ -4,9 +4,8 @@ using GiecChallenge.Services; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using System.Text; -using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.HttpOverrides; -using System.Net; +using GiecChallenge.Profiles; var builder = WebApplication.CreateBuilder(args); ConfigurationManager configuration = builder.Configuration; @@ -32,7 +31,15 @@ builder.Services.AddSwaggerGen(c => c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); }); -builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); +builder.Services.AddAutoMapper( + typeof(CurrencyProfile), + typeof(GroupProfile), + typeof(LanguageProfile), + typeof(ProductProfile), + typeof(PurchaseProfile), + typeof(SubGroupProfile), + typeof(UserProfile) +); builder.Services.AddAuthentication(options => {