Files
managing-apps/src/Managing.Application/ManageBot/DeleteBotCommandHandler.cs
2024-07-12 22:20:43 +07:00

23 lines
695 B
C#

using Managing.Application.Abstractions;
using Managing.Application.ManageBot.Commands;
using MediatR;
using Microsoft.Extensions.Logging;
namespace Managing.Application.ManageBot;
public class DeleteBotCommandHandler : IRequestHandler<DeleteBotCommand, bool>
{
private readonly ILogger<DeleteBotCommandHandler> _log;
private readonly IBotService _botService;
public DeleteBotCommandHandler(ILogger<DeleteBotCommandHandler> log, IBotService botService)
{
_log = log;
_botService = botService;
}
public Task<bool> Handle(DeleteBotCommand request, CancellationToken cancellationToken)
{
return _botService.DeleteBot(request.Name);
}
}