Esempio n. 1
0
        public IActionResult Delete(string id)
        {
            var result = _context._Users.FirstOrDefault(x => x.Id == id);

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

            try
            {
                _context.Remove(result);
                _context.SaveChanges();
            }
            catch
            {
                return(Conflict("Could not delete the user!"));
            }
            return(Ok());
        }