public Task <HttpResponseMessage> Delete(int id) { var command = new DeletePaymentToCompanyCommand( idPaymentToCompany: id ); var payment = _service.Delete(command); return(CreateResponse(HttpStatusCode.OK, payment)); }
public PaymentToCompany Delete(DeletePaymentToCompanyCommand command) { var payment = _repository.GetById(command.IdPaymentToCompany); _repository.Delete(payment); if (Commit()) { return(payment); } return(null); }