mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
17 lines
584 B
C#
17 lines
584 B
C#
using Features.Breweries.Repository;
|
|
using MediatR;
|
|
|
|
namespace Features.Breweries.Commands.DeleteBrewery;
|
|
|
|
/// <summary>
|
|
/// Handles <see cref="DeleteBreweryCommand" /> by deleting the matching brewery post.
|
|
/// </summary>
|
|
/// <param name="repository">Repository used to delete the brewery post.</param>
|
|
public class DeleteBreweryHandler(IBreweryRepository repository)
|
|
: IRequestHandler<DeleteBreweryCommand>
|
|
{
|
|
public Task Handle(DeleteBreweryCommand request, CancellationToken cancellationToken)
|
|
{
|
|
return repository.DeleteAsync(request.BreweryPostId);
|
|
}
|
|
} |