private async Task <UserRegistrationProcess> GetProcessOrExceptionAsync(Guid userId)
        {
            var maybeProcess = await _userRegistrationProcessRepository.GetAsync(userId);

            var errorMessage =
                $"Could not find user registration process for user {userId}. Repository seems to be corrupted.";

            return(maybeProcess.ValueOrFailure(errorMessage));
        }
Example #2
0
        public async Task <Option <UserRegstrationProcessQueryResult> > GetAsync(Guid userId)
        {
            var maybeProcess = await _userRegistrationProcessRepository.GetAsync(userId);

            return(maybeProcess.Select(process => ToQueryResult(process.State)));
        }