示例#1
0
        public IHttpActionResult Remove(InvoiceRemoveCommand command)
        {
            var validator = command.Validate();

            if (!validator.IsValid)
            {
                return(HandleValidationFailure(validator.Errors));
            }

            return(HandleCallback(_invoiceService.Remove(command)));
        }
示例#2
0
        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);
        }