public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new AdminUser
                {
                    UserName          = model.Email,
                    Email             = model.Email,
                    CompanyName       = model.CompanyName,
                    IsAdmin           = true,
                    SubsciptionStatus = "Free Plan"
                };

                var result = await AdminUserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    var company = await _companyRepository.CreateCompanyAsync(model.CompanyName);

                    user.CompanyId = company.CompanyId;
                    await AdminUserManager.UpdateAsync(user);

                    result = await AdminUserManager.AddToRoleAsync(user.Id, "Admin");
                }

                if (result.Succeeded)
                {
                    await AdminSignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false);

                    // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return(RedirectToAction("Index", "Admin"));
                }
                AddErrors(result);
            }

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