Beispiel #1
0
        public async Task DeleteAsync(Guid id)
        {
            var shipment = await shipmentRepository.GetAndEnsureExistAsync(id);

            if (shipment.Orders.Count > 0)
            {
                throw new StreetwoodException(ErrorCode.ShipmentInUse);
            }

            await shipmentRepository.DeleteAsync(shipment);

            await shipmentRepository.SaveChangesAsync();
        }
Beispiel #2
0
 public async Task DeleteAsync(ShipmentDTO item)
 {
     await _repo.DeleteAsync(_mapper.Map <Shipment>(item));
 }