コード例 #1
0
        public static void CreateNewStudent(String eMail, IUserRepository repository,
            IStudentRepository studentRepository)
        {
            if (!repository.UserExist(eMail))
            {
                String[] split = Regex.Split(eMail, "@");
                String[] naamSplit = Regex.Split(eMail, ".");
                String voornaam = naamSplit[0];
                String achternaam = naamSplit[1];
                String pasw = split[0];
                Student student = new Student()
                {
                    UserName = eMail,
                    Voornaam = voornaam,
                    Naam = achternaam

                };
                //studentRepository.AddStudent(student);
                repository.CreateAsyncUser(student, pasw);

               // studentRepository.SaveChanges();
            }
        }
コード例 #2
0
 public void AddStudent(Student student)
 {
     if (StageStudenten.Count == AantalStudenten)
     {
         throw new ArgumentException("Deze opdracht zit reeds vol");
     }
     StageStudenten.Add(student);
 }
コード例 #3
0
 public void AddStudent(Student student)
 {
     context.Studenten.Add(student);
     //context.SaveChanges();
 }