public IHttpActionResult Remove(InvoiceRemoveCommand command) { var validator = command.Validate(); if (!validator.IsValid) { return(HandleValidationFailure(validator.Errors)); } return(HandleCallback(_invoiceService.Remove(command))); }
public bool Remove(InvoiceRemoveCommand command) { var isRemovedAll = true; foreach (int id in command.InvoicesId) { var isRemoved = _invoiceRepository.Remove(id); isRemovedAll = isRemoved ? isRemovedAll : false; } return(isRemovedAll); }