public virtual async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser()
                {
                    UserName = model.UserName
                };
                var result = await _securityManager.CreateRegistrationAsync(user, model.Password);

                if (result.Succeeded)
                {
                    await ServiceLocator.Instance.Resolve <IAuthenticationProvider>(new DependencyOverride(typeof(IAuthenticationManager), _authenticationManager)).SignInAsync(user, isPersistent: false);

                    return(RedirectToAction(MVC.Home.Index()));
                }
                else
                {
                    AddErrors(result);
                }
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }