fixes and tweaks

This commit is contained in:
moarten
2026-04-29 20:36:08 +02:00
parent b71f45e76c
commit 385119bb27
58 changed files with 1512 additions and 350 deletions
@@ -3,29 +3,28 @@ using Lutra.Application.Interfaces;
using Lutra.Application.Models.Supermarkten;
using Microsoft.EntityFrameworkCore;
namespace Lutra.Application.Supermarkten
{
public sealed partial class GetSupermarkten
{
public sealed class Handler(ILutraDbContext context) : IQueryHandler<Query, Response>
{
public async Task<Response> Handle(Query request, CancellationToken cancellationToken)
{
var supermarkten = await context.Supermarkten
.AsNoTracking()
.Where(w => w.DeletedAt == null)
.OrderBy(s => s.Naam)
.Skip(request.Skip)
.Take(request.Take)
.Select(s => new Supermarkt
{
Id = s.Id,
Naam = s.Naam
})
.ToListAsync(cancellationToken);
namespace Lutra.Application.Supermarkten;
return new Response { Supermarkten = supermarkten };
}
public sealed partial class GetSupermarkten
{
public sealed class Handler(ILutraDbContext context) : IQueryHandler<Query, Response>
{
public async Task<Response> Handle(Query request, CancellationToken cancellationToken)
{
var supermarkten = await context.Supermarkten
.AsNoTracking()
.Where(w => w.DeletedAt == null)
.OrderBy(s => s.Naam)
.Skip(request.Skip)
.Take(request.Take)
.Select(s => new Supermarkt
{
Id = s.Id,
Naam = s.Naam
})
.ToListAsync(cancellationToken);
return new Response { Supermarkten = supermarkten };
}
}
}