Exemplo n.º 1
0
 public async Task Do(ProductInOrdersViewModel vm)
 {
     _context.ProductInOrders.Add(new ProductInOrder
     {
         OrderRefId   = vm.OrderRefId,
         ProductRefId = vm.ProductRefId,
         UsedQuantity = vm.UsedQuantity,
     });
     await _context.SaveChangesAsync();
 }
        public async Task Do(ProductInOrdersViewModel vm)
        {
            var productInOrder = new ProductInOrder
            {
                OrderRefId   = vm.OrderRefId,
                ProductRefId = vm.ProductRefId,
                UsedQuantity = vm.UsedQuantity,
            };

            _context.ProductInOrders.Update(productInOrder);
            await _context.SaveChangesAsync();
        }