public bool Delete(int id) { var existing = db.Classes.FirstOrDefault(c => c.Id == id); if (existing == null) { return(false); } db.Remove(existing); db.SaveChanges(); return(true); }