public ActionResult Edit(int id, UserViewModel userModel)
        {
            try
            {
                var user            = users.GetList().FirstOrDefault(u => u.Id == id);// использую такой костыль т.к. в availableRewards возвращался неполный объект
                var userAwards      = awards.GetList().Select(a => AwardViewModel.GetViewModel(a, user.GetAwards()));
                var checkedAwards   = userModel.AvailableRewards.Where(a => a.Checked);
                var availableAwards = userAwards.Where(a => checkedAwards.Any(aw => aw.Id == a.Id));
                var deletedAwards   = userAwards.Where(a => !checkedAwards.Any(aw => aw.Id == a.Id));

                foreach (var award in availableAwards)
                {
                    award.Checked = true;
                    users.AddAward(id, award.Id);
                }

                foreach (var award in deletedAwards)
                {
                    award.Checked = false;
                    users.RemoveAward(id, award.Id);
                }

                userModel.AvailableRewards = availableAwards.ToList();
                users.Edit(userModel.ToUser());
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
 public ActionResult Create(UserViewModel userModel)
 {
     try
     {
         users.Add(userModel.ToUser());
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }