public IActionResult ChangeEmail()
        {
            ChangeEmailPageViewModel model = new ChangeEmailPageViewModel()
            {
                Categories = _categoryLogic.GetAll().Select(c => new CategoryViewModel {
                    Id = c.CategoryId, Name = c.Name
                }).ToList(),
            };

            return(View(model));
        }
 public IActionResult ChangeEmail(ChangeEmailPageViewModel model)
 {
     if (model.Email != null)
     {
         User user = new User {
             UserId = (int)HttpContext.Session.GetInt32("UserId"), Email = model.Email
         };
         _accountLogic.UpdateUserEmail(user);
         return(RedirectToAction("Settings", "Account"));
     }
     return(RedirectToAction("Settings", "Account"));
 }