Esempio n. 1
0
        public void Create()
        {
            using (var sm = new StudentManager())
            {
                Student s = new Student();

            }
        }
Esempio n. 2
0
 public bool AddStudent(Student v)
 {
     db.Students.Add(v);
     if (!Save())
     {
         return false;
     }
     return true;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }