public async Task <Response <Factura> > Handle(DeleteFacturaCommand request, CancellationToken cancellationToken) { var factura = await _repository.FindByIdAsync(request.Id); if (factura == null) { return(new Response <Factura>("Factura No Encontrada.")); } _repository.Delete(factura); await _unitOfWork.CompleteAsync(); return(new Response <Factura>(factura)); }
public bool Delete(int id) { return(facturaRepository.Delete(id)); }