Update to latest packages and show examples

This commit is contained in:
2026-07-05 22:05:53 +02:00
parent 3a36978997
commit c7ddc282ed
52 changed files with 2156 additions and 21 deletions
@@ -0,0 +1,30 @@
using GerstITS.Examples.Logic.Customers;
using Microsoft.AspNetCore.Mvc;
namespace GerstITS.Examples.Api.Endpoints;
internal static partial class Endpoints
{
internal static RouteGroupBuilder MapCustomerNoteEndpoints(this RouteGroupBuilder group)
{
CustomerNotes.MapGetByCustomer(group);
CustomerNotes.MapAdd(group);
return group;
}
internal static class CustomerNotes
{
internal static void MapGetByCustomer(RouteGroupBuilder group)
{
group.MapGet("customers/{id:int}/notes", (int id, ICustomerProvider customerProvider) =>
Results.Ok(customerProvider.GetNotes(id)));
}
internal static void MapAdd(RouteGroupBuilder group)
{
group.MapPost("customers/{id:int}/notes", (int id, [FromBody] CustomerNote note, ICustomerProvider customerProvider) =>
Results.Ok(customerProvider.AddNote(id, note.Text)));
}
}
}