Exemple #1
0
        public IActionResult Delete(int id)
        {
            var category = _context.Categories.Find(id);

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

            _context.Remove <Category>(category);

            return(new NoContentResult());
        }
Exemple #2
0
        public IActionResult Delete(int id)
        {
            var property = _context.Properties.Find(id);

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

            _context.Remove <Property>(property);

            return(new NoContentResult());
        }
 public async Task <int> Delete(long id)
 {
     _context.Remove <T>(Get(id));
     return(await _context.SaveChangesAsync());
 }