Example #1
0
        private async Task  productInListInitial(int productId, string username)
        {
            productOnsalelist pr = new productOnsalelist();

            pr.ProductId = productId;
            pr.username  = username;
            pr.date      = DateTime.Now;
            pr.quantity  = 1;
            _context.productOnsalelists.Add(pr);
            await _context.SaveChangesAsync();
        }
Example #2
0
 private async Task updateProductOnSale(productOnsalelist trans)
 {
     _context.Set <productOnsalelist>().AddOrUpdate(trans);
     await _context.SaveChangesAsync();
 }