public void DeleteOutboundList(OutboundList outboundList)
        {
            if (outboundList == null)
            {
                throw new ArgumentNullException(nameof(outboundList));
            }

            foreach (var outboundProduct in outboundList.OutboundProducts)
            {
                _context.OutboundProducts.Remove(outboundProduct);
            }
            _context.OutboundLists.Remove(outboundList);
        }
        public void AddOutboundList(OutboundList outboundList)
        {
            if (outboundList == null)
            {
                throw new ArgumentNullException(nameof(outboundList));
            }

            outboundList.Id = Guid.NewGuid();
            if (outboundList.OutboundProducts != null)  //这里在添加入库单的时候一并添加入库产品
            {
                foreach (var outboundProduct in outboundList.OutboundProducts)
                {
                    outboundProduct.Id = Guid.NewGuid();
                }
            }
            _context.OutboundLists.Add(outboundList);
        }
        public async Task <OutboundList> GetOutboundListAsync(Guid outboundListId)
        {
            if (outboundListId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(outboundListId));
            }
            var outboundList = _context.OutboundLists
                               .FirstOrDefaultAsync(x => x.Id == outboundListId);

            if (outboundList.Result == null)
            {
                return(outboundList.Result);
            }
            var outboundProduct = _context.OutboundProducts.Where(x => x.OutboundListId == outboundListId);

            outboundList.Result.OutboundProducts = outboundProduct.ToList();
            OutboundList s1 = outboundList.Result;

            return(s1);
        }
 public void UpdateOutboundList(OutboundList outboundList)
 {
 }