Update to .Net 8.0

This commit is contained in:
Maxime Boulay 2025-04-19 22:04:18 +02:00
parent ba64ceb471
commit 8e5c9cfffb
3 changed files with 56 additions and 14 deletions

36
GiecChallenge.sln Normal file
View File

@ -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

View File

@ -1,30 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.0" /> <PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" /> <PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Build.Containers" Version="0.2.7" /> <PackageReference Include="Microsoft.NET.Build.Containers" Version="9.0.203" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.1" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -4,9 +4,8 @@ using GiecChallenge.Services;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.HttpOverrides;
using System.Net; using GiecChallenge.Profiles;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
ConfigurationManager configuration = builder.Configuration; ConfigurationManager configuration = builder.Configuration;
@ -32,7 +31,15 @@ builder.Services.AddSwaggerGen(c =>
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); 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 => builder.Services.AddAuthentication(options =>
{ {