Ejemplo n.º 1
0
        public async Task Handle()
        {
            await userFriendsService.CreateUserFriendsRecord(user.ID).ConfigureAwait(false);

            ActivationCode activationCode = codesService.CreateActivationCode(user.ID);
            await codesService.InsertCodeInDatabaseAsync(activationCode).ConfigureAwait(false);

            await userMainFoldersService.CreateNewUserMainFolders(user.ID).ConfigureAwait(false);

            await documentDeskStateService.CreateDeskStateAsync(user.ID).ConfigureAwait(false);

            //await emailService.SendConfirmationEmailAsync(activationCode.Code, user.Email).ConfigureAwait(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an activation code and sends this code to the user on the given email.
        /// </summary>
        /// <exception cref="DatabaseException">
        /// Throws this exception if the error occurs while working with the database service.
        /// This exception provides the meaningful description for the error, so this message
        /// can be returned to the user.
        /// </exception>
        public async Task Handle()
        {
            try
            {
                ActivationCode activationCode = codesService.CreateActivationCode(userID);
                //await codesService.InsertCodeInDatabaseAsync(activationCode).ConfigureAwait(false);

                //await emailService.SendConfirmationEmailAsync(activationCode.Code, email).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                exceptionLogger.Log(new ApplicationError(ex), LogLevel.Error, logConfiguration);
                throw new DatabaseException("The error occured while sending confirmation email");
            }
        }