public ActionResult Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                try {
                    var securityToken = _securityProvider.CreateUserAndAccount(model.Email, model.Password, requireConfirmationToken: true);
                    _emailProvider.SendAccountActivationEmail(model.Email, securityToken, System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"]);
                    return(RedirectToAction("Created", "Account"));
                }
                catch (MembershipCreateUserException e) {
                    log.Info(string.Format("Could not create account for {0} - {1}", model.Email, e.Message));
                    ModelState.AddModelError("", ErrorCodeToString(e.StatusCode));
                }
                catch (Exception ex)
                {
                    log.Error("Unhandled exception in Account/Register", ex);
                    ModelState.AddModelError("", "Oops, something went wrong.");
                }
            }

            return(View());
        }