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(); }
public async Task DeleteAsync(ShipmentDTO item) { await _repo.DeleteAsync(_mapper.Map <Shipment>(item)); }