public ActionResult Add(DelegationSetting model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    this.delegationRepository.Add(model);
                    TempData["Message"] = Resources.DelegationController.RealmAdded;
                    return RedirectToAction("Configure", new { id = model.UserName });
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
                catch
                {
                    ModelState.AddModelError("", Resources.DelegationController.ErrorAddingDelegationSetting);
                }
            }

            var vm = new DelegationSettingsForUserViewModel(this.delegationRepository, this.userManagementRepository, model.UserName);
            return View("Configure", vm);
        }
 public ActionResult Configure(string id = null)
 {
     var vm = new DelegationSettingsForUserViewModel(this.delegationRepository, this.userManagementRepository, id);
     return View("Configure", vm);
 }