コード例 #1
0
        public async Task RegisterMasterAsync(string name, string surname, string email, string phoneNumber, string password)
        {
            if (await _masterService.ExistByEmailAsync(email.ToLowerInvariant()))
            {
                throw new ObjectAlreadyExistException($"User of given email: {email} already exist.");
            }
            var master        = new Master(name, surname, email, phoneNumber, password);
            var activationKey = Guid.NewGuid();

            master.AddAccountActivation(new AccountActivation(activationKey));
            await _masterRepository.AddAsync(master);

            await _accountEmailFactory.SendActivationEmailAsync(master, activationKey);
        }