public void ChangeLesson(int id) { Lesson ls = Lessons.Find(id); if (ls != null) { Entry(ls).State = EntityState.Modified; ls.Finish = true; } SaveChanges(); }