23 lines
695 B
C#
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);
|
|
}
|
|
} |