MyBookmark/Modules.Library.Application/Commands/Dictionaries/Genre/DeleteGenreCommand.cs
2024-09-23 03:00:50 +03:00

18 lines
530 B
C#

using MediatR;
using Modules.Library.Application.Gateways;
namespace Modules.Library.Application.Commands.Dictionaries.Genre;
public class DeleteGenreCommand : IRequest<Unit>
{
public Guid Id { get; set; } = default!;
}
public class DeleteGenreCommandHandler(IGenreGateway genreGateway) : IRequestHandler<DeleteGenreCommand, Unit>
{
public async Task<Unit> Handle(DeleteGenreCommand request, CancellationToken cancellationToken)
{
await genreGateway.Delete(request.Id);
return Unit.Value;
}
}