Пример #1
0
        public void Create()
        {
            using (var sm = new StudentManager())
            {
                Student s = new Student();

            }
        }
Пример #2
0
 public bool AddStudent(Student v)
 {
     db.Students.Add(v);
     if (!Save())
     {
         return false;
     }
     return true;
 }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }