示例#1
0
        public async Task RegisterAsync(Student student)
        {
            if (student == null)
            {
                throw new ArgumentNullException(nameof(student));
            }
            await userRegistration.RegisterAsync(student.User);

            await studentRepository.InsertAsync(student);
        }
        public async Task RegisterAsync(Teacher teacher, string secretWord)
        {
            if (teacher == null)
            {
                throw new ArgumentNullException(nameof(teacher));
            }
            if (secretWord != SecretWord)
            {
                throw new InvalidSecretWordException();
            }

            await userRegistration.RegisterAsync(teacher.User);

            await teacherRepository.InsertAsync(teacher);
        }