Ejemplo n.º 1
0
        public async Task <ActionResult <Product> > DeleteProduct(long id)
        {
            var product = await _context.Product.FindAsync(id);

            if (product == null)
            {
                return(NotFound());
            }

            _context.Product.Remove(product);
            await _context.SaveChangesAsync();

            return(product);
        }
Ejemplo n.º 2
0
 public async Task <bool> SaveChangesAsync()
 {
     return((await _context.SaveChangesAsync()) > 0);
 }