forked from sanchezvem/PyroFetes
20 lines
579 B
C#
20 lines
579 B
C#
using FastEndpoints;
|
|
using PyroFetes.DTO.DeliveryNote.Response;
|
|
using PyroFetes.Repositories;
|
|
|
|
namespace PyroFetes.Endpoints.DeliveryNotes;
|
|
|
|
public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRepository) : EndpointWithoutRequest<List<GetDeliveryNoteDto>>
|
|
{
|
|
public override void Configure()
|
|
{
|
|
Get("/deliveryNotes");
|
|
AllowAnonymous();
|
|
}
|
|
|
|
public override async Task HandleAsync(CancellationToken ct)
|
|
{
|
|
await Send.OkAsync(await deliveryNotesRepository.ProjectToListAsync<GetDeliveryNoteDto>(ct), ct);
|
|
}
|
|
|
|
} |