public async Task <OperationResult> Handle(RemoveSistemaCommand request, CancellationToken cancellationToken = default)
    {
        Sistema obj = await _unitOfWork.SistemaRepository.GetAsync(request.Id);

        if (obj == null)
        {
            return(OperationResult.NotFound);
        }

        await _unitOfWork.SistemaRepository.RemoveAsync(request.Id);

        bool success = await _unitOfWork.SaveChangesAsync();

        OperationResult result = success ? OperationResult.Success : OperationResult.Failed;

        if (result == OperationResult.Success)
        {
            await _eventHandler.PublishEventAsync(new RemoveSistemaEvent { Id = request.Id });
        }

        return(result);
    }
 public async UnaryResult <OperationResult> RemoveAsync(RemoveSistemaCommand command)
 {
     return(await _mediator.Send(command));
 }