public void Delete() { using (var context = new Entities()) { var model = context.AthleteClasses.Where(athleteclass => athleteclass.ID == Id).Single(); context.DeleteObject(model); context.SaveChanges(); } }