Added Aspire
This commit is contained in:
14
Lutra/Lutra.API/Controllers/HealthController.cs
Normal file
14
Lutra/Lutra.API/Controllers/HealthController.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using Microsoft.AspNetCore.Http.HttpResults;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace Lutra.API.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("health")]
|
||||||
|
public class HealthController : Controller
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<UserSecretsId>c9bd54b0-d347-4e93-bcea-ed5e98a71d5c</UserSecretsId>
|
<UserSecretsId>c9bd54b0-d347-4e93-bcea-ed5e98a71d5c</UserSecretsId>
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Cortex.Mediator" Version="1.7.0" />
|
<PackageReference Include="Cortex.Mediator" Version="2.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
13
Lutra/Lutra.AppHost/AppHost.cs
Normal file
13
Lutra/Lutra.AppHost/AppHost.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
var builder = DistributedApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
var sql = builder.AddSqlServer("sql")
|
||||||
|
.WithLifetime(ContainerLifetime.Persistent);
|
||||||
|
|
||||||
|
var db = sql.AddDatabase("database", "Lutra");
|
||||||
|
|
||||||
|
var apiService = builder.AddProject<Projects.Lutra_API>("apiservice")
|
||||||
|
.WithHttpHealthCheck("/health")
|
||||||
|
.WithReference(db)
|
||||||
|
.WaitFor(db);
|
||||||
|
|
||||||
|
builder.Build().Run();
|
||||||
22
Lutra/Lutra.AppHost/Lutra.AppHost.csproj
Normal file
22
Lutra/Lutra.AppHost/Lutra.AppHost.csproj
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<Sdk Name="Aspire.AppHost.Sdk" Version="9.5.0" />
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UserSecretsId>cb3bf793-12ac-4e3d-9aeb-c2e3cb36a9fe</UserSecretsId>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.1.0" />
|
||||||
|
<PackageReference Include="Aspire.Hosting.SqlServer" Version="13.1.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Lutra.API\Lutra.API.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
29
Lutra/Lutra.AppHost/Properties/launchSettings.json
Normal file
29
Lutra/Lutra.AppHost/Properties/launchSettings.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"profiles": {
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:17126;http://localhost:15299",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
|
"DOTNET_ENVIRONMENT": "Development",
|
||||||
|
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21049",
|
||||||
|
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22271"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "http://localhost:15299",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
|
"DOTNET_ENVIRONMENT": "Development",
|
||||||
|
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19176",
|
||||||
|
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20117"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Lutra/Lutra.AppHost/appsettings.Development.json
Normal file
8
Lutra/Lutra.AppHost/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Lutra/Lutra.AppHost/appsettings.json
Normal file
9
Lutra/Lutra.AppHost/appsettings.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Aspire.Hosting.Dcp": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Lutra/Lutra.Application/Interfaces/ILutraDbContext.cs
Normal file
12
Lutra/Lutra.Application/Interfaces/ILutraDbContext.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Lutra.Domain.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
namespace Lutra.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ILutraDbContext
|
||||||
|
{
|
||||||
|
DbSet<Supermarkt> Supermarkten { get; }
|
||||||
|
|
||||||
|
DbSet<Verspakket> Verspaketten { get; }
|
||||||
|
|
||||||
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
||||||
|
}
|
||||||
@@ -1,13 +1,18 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Cortex.Mediator" Version="1.7.0" />
|
<PackageReference Include="Cortex.Mediator" Version="2.1.0" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Lutra.Domain\Lutra.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Lutra.Domain
|
|
||||||
{
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
14
Lutra/Lutra.Domain/Entities/BaseEntity.cs
Normal file
14
Lutra/Lutra.Domain/Entities/BaseEntity.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
namespace Lutra.Domain.Entities;
|
||||||
|
|
||||||
|
public abstract class BaseEntity
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreatedAt { get; set; }
|
||||||
|
|
||||||
|
public DateTime ModifiedAt { get; set; }
|
||||||
|
|
||||||
|
public DateTime? DeletedAt { get; set; }
|
||||||
|
|
||||||
|
public bool IsDeleted => DeletedAt.HasValue;
|
||||||
|
}
|
||||||
9
Lutra/Lutra.Domain/Entities/Supermarkt.cs
Normal file
9
Lutra/Lutra.Domain/Entities/Supermarkt.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Lutra.Domain.Entities;
|
||||||
|
|
||||||
|
public class Supermarkt : BaseEntity
|
||||||
|
{
|
||||||
|
[MaxLength(50)]
|
||||||
|
public required string Naam { get; set; }
|
||||||
|
}
|
||||||
23
Lutra/Lutra.Domain/Entities/Verspakket.cs
Normal file
23
Lutra/Lutra.Domain/Entities/Verspakket.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Lutra.Domain.Entities;
|
||||||
|
|
||||||
|
public class Verspakket : BaseEntity
|
||||||
|
{
|
||||||
|
[MaxLength(50)]
|
||||||
|
public required string Naam { get; set; }
|
||||||
|
|
||||||
|
[Range(1, 100)]
|
||||||
|
public int Cijfer { get; set; }
|
||||||
|
|
||||||
|
[MaxLength(255)]
|
||||||
|
public string? Opmerking { get; set; }
|
||||||
|
|
||||||
|
[Range(1, 10)]
|
||||||
|
public int AantalPersonen { get; set; }
|
||||||
|
|
||||||
|
public required Guid SupermarktId { get; set; }
|
||||||
|
|
||||||
|
public required virtual Supermarkt Supermarkt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Lutra.Infrastructure
|
|
||||||
{
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
Lutra/Lutra.Infrastructure/Lutra.Infrastructure.Sql.csproj
Normal file
17
Lutra/Lutra.Infrastructure/Lutra.Infrastructure.Sql.csproj
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Lutra.Application\Lutra.Application.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
Lutra/Lutra.Infrastructure/LutraDbContext.cs
Normal file
20
Lutra/Lutra.Infrastructure/LutraDbContext.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Lutra.Application.Interfaces;
|
||||||
|
using Lutra.Domain.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Lutra.Infrastructure.Sql;
|
||||||
|
|
||||||
|
public class LutraDbContext : ILutraDbContext
|
||||||
|
{
|
||||||
|
public DbSet<Supermarkt> Supermarkten => throw new NotImplementedException();
|
||||||
|
|
||||||
|
public DbSet<Verspakket> Verspaketten => throw new NotImplementedException();
|
||||||
|
|
||||||
|
public Task<int> SaveChangesAsync(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 18
|
||||||
VisualStudioVersion = 17.14.36310.24
|
VisualStudioVersion = 18.3.11222.16
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.API", "Lutra.API\Lutra.API.csproj", "{22B74CFE-E9D0-42F3-96E3-818D014E1A2E}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.API", "Lutra.API\Lutra.API.csproj", "{22B74CFE-E9D0-42F3-96E3-818D014E1A2E}"
|
||||||
EndProject
|
EndProject
|
||||||
@@ -9,7 +9,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Application", "Lutra.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Domain", "Lutra.Domain\Lutra.Domain.csproj", "{DACBC33C-A76A-483A-8535-AA62D33D4977}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Domain", "Lutra.Domain\Lutra.Domain.csproj", "{DACBC33C-A76A-483A-8535-AA62D33D4977}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Infrastructure", "Lutra.Infrastructure\Lutra.Infrastructure.csproj", "{0D9E0DD9-E914-483F-8046-8A57B510E984}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Infrastructure.Sql", "Lutra.Infrastructure\Lutra.Infrastructure.Sql.csproj", "{0D9E0DD9-E914-483F-8046-8A57B510E984}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.AppHost", "Lutra.AppHost\Lutra.AppHost.csproj", "{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -33,6 +35,10 @@ Global
|
|||||||
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Release|Any CPU.Build.0 = Release|Any CPU
|
{0D9E0DD9-E914-483F-8046-8A57B510E984}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user