public IActionResult Delete(int id) { var category = _context.Categories.Find(id); if (category == null) { return(NotFound()); } _context.Remove <Category>(category); return(new NoContentResult()); }
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()); }