public async Task <ActionResult <CreateResponse> > Create(CreateRequest request, CancellationToken cancellationToken)
        {
            foreach (var desiredAppRoleName in request.AppRoles)
            {
                var desiredAppRole = await _appRoleService.FindAppRoleByNameAsync(desiredAppRoleName, cancellationToken).ConfigureAwait(false);

                if (desiredAppRole is null)
                {
                    return(BadRequest($"Role {desiredAppRole} not found"));
                }
            }

            var newAppUser = new AppUser
            {
                Email    = request.Email,
                UserName = request.Email
                           // TODO: name
            };
            var createAppUserResult = await UserManager.CreateAsync(newAppUser).ConfigureAwait(false);

            if (!createAppUserResult.Succeeded)
            {
                Logger.LogDebug("Failed to create app user {appUserEmail}. Result: {result}", newAppUser.Email, createAppUserResult);
                return(BadRequest(createAppUserResult.Errors));
            }

            var addToRolesResult = await UserManager.AddToRolesAsync(newAppUser, request.AppRoles).ConfigureAwait(false);

            if (!addToRolesResult.Succeeded)
            {
                Logger.LogDebug("Failed to add new app user {appUserEmail} to roles. Result: {result}", newAppUser.Email, addToRolesResult);
                return(BadRequest(addToRolesResult.Errors));
            }

            var confirmEmailUrl = await GenerateConfirmEmailUrl(newAppUser, cancellationToken).ConfigureAwait(false);

            await _emailSender.SendEmailAsync
            (
                newAppUser.Email,
                "Confirm Email - Inventory System",
                $"Please confirm your email address by <a href='{HtmlEncoder.Default.Encode(confirmEmailUrl)}'>clicking here</a>.",
                cancellationToken
            ).ConfigureAwait(false);

            Logger.LogDebug("Created new app user {appUserEmail}", newAppUser.Email);

            return(new CreateResponse
            {
                NewAppUserId = newAppUser.Id,
                EmailConfirmationUrl = confirmEmailUrl
            });
        }