public void Create() { using (var sm = new StudentManager()) { Student s = new Student(); } }
public bool AddStudent(Student v) { db.Students.Add(v); if (!Save()) { return false; } return true; }
public bool RemoveStudent(Student v) { if (!db.Students.Local.Contains(v)) { db.Students.Attach(v); } db.Students.Remove(v); if (!Save()) { return false; } return true; }
public bool UpdateStudent(Student v) { if (!db.Students.Local.Contains(v)) { db.Students.Attach(v); } db.Entry<Student>(v).State = EntityState.Modified; if (!Save()) { return false; } return true; }