public void UpdateStudent(Student MyStudent) { using (var DB = new MatrixDBEntities()) { var Query = DB.ETUDIANTS.Where(S => S.GUID == MyStudent.GUID); // ReSharper disable once NotAccessedVariable var ST = Query.Single(); ST = FromStudent(MyStudent); DB.SaveChanges(); } }
public void AddStudent(ETUDIANT MyStudent) { ETUDIANT newStudent = MyStudent; //var newStudent = FromStudent (MyStudent); using (var DB = new MatrixDBEntities()) { newStudent.GUID = Guid.NewGuid(); DB.ETUDIANTS.Add(newStudent); DB.SaveChanges(); } }