Exemplo n.º 1
0
        public IActionResult DeleteTournament(int?id = null)
        {
            if (id == null)
            {
                return(BadRequest("Tournament ID is not provided"));
            }

            var removeItem = _Context.Tournaments.SingleOrDefault(t => t.ID == id);

            if (removeItem == null)
            {
                return(BadRequest("Tournament ID is not found"));
            }

            _Context.Remove(removeItem);
            _Context.SaveChanges();

            return(Ok(new
            {
                message = "OK"
            }));
        }
Exemplo n.º 2
0
 public void Delete(Product product)
 {
     _context.Remove(product);
 }