refactor(API): update to use .net8

This commit is contained in:
tekh 2025-07-29 14:23:55 +02:00
parent 48724922af
commit 467588429b
5 changed files with 49 additions and 27 deletions

View File

@ -5,10 +5,10 @@ VisualStudioVersion = 17.14.36221.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.ActiveDirectory.API", "src\DigitalData.ActiveDirectory.API\DigitalData.ActiveDirectory.API.csproj", "{9DDE61F2-25D7-4101-9E26-F9215C9277A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.ActiveDirectory", "src\DigitalData.ActiveDirectory\DigitalData.ActiveDirectory.csproj", "{26B810C2-8D06-42CF-999F-CB508C9D2D01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.ActiveDirectory.API", "src\DigitalData.ActiveDirectory.API\DigitalData.ActiveDirectory.API.csproj", "{2B3A9620-E298-00ED-CC4B-A6A83F822A01}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -19,18 +19,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|x64.ActiveCfg = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|x64.Build.0 = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|x86.ActiveCfg = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Debug|x86.Build.0 = Debug|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|Any CPU.Build.0 = Release|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|x64.ActiveCfg = Release|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|x64.Build.0 = Release|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|x86.ActiveCfg = Release|Any CPU
{9DDE61F2-25D7-4101-9E26-F9215C9277A2}.Release|x86.Build.0 = Release|Any CPU
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -43,13 +31,25 @@ Global
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Release|x64.Build.0 = Release|Any CPU
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Release|x86.ActiveCfg = Release|Any CPU
{26B810C2-8D06-42CF-999F-CB508C9D2D01}.Release|x86.Build.0 = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|x64.ActiveCfg = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|x64.Build.0 = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|x86.ActiveCfg = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Debug|x86.Build.0 = Debug|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|Any CPU.Build.0 = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|x64.ActiveCfg = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|x64.Build.0 = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|x86.ActiveCfg = Release|Any CPU
{2B3A9620-E298-00ED-CC4B-A6A83F822A01}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9DDE61F2-25D7-4101-9E26-F9215C9277A2} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{26B810C2-8D06-42CF-999F-CB508C9D2D01} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{2B3A9620-E298-00ED-CC4B-A6A83F822A01} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F00C94F-CA5D-4F53-A608-B935F0FD4B46}

View File

@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.5.25277.114" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.18" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>
</Project>

View File

@ -1,4 +1,4 @@
@DigitalData.ActiveDirectory.API_HostAddress = http://localhost:5051
@DigitalData.ActiveDirectory.API_HostAddress = http://localhost:5092
GET {{DigitalData.ActiveDirectory.API_HostAddress}}/weatherforecast/
Accept: application/json

View File

@ -1,15 +1,17 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
@ -31,7 +33,8 @@ app.MapGet("/weatherforecast", () =>
.ToArray();
return forecast;
})
.WithName("GetWeatherForecast");
.WithName("GetWeatherForecast")
.WithOpenApi();
app.Run();

View File

@ -1,11 +1,20 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:34411",
"sslPort": 44378
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5051",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5092",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@ -13,8 +22,17 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7149;http://localhost:5051",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7221;http://localhost:5092",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}