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(); } }
public void AddStudent(Student student) { if (StageStudenten.Count == AantalStudenten) { throw new ArgumentException("Deze opdracht zit reeds vol"); } StageStudenten.Add(student); }
public void AddStudent(Student student) { context.Studenten.Add(student); //context.SaveChanges(); }