public ActionResult Edit(FeatureModel featureModel) { try { var feature = _featureRepository.Get(featureModel.Id); feature.Name = featureModel.Name; feature.FeatureSwitchStatus = featureModel.FeatureStatus; _featureRepository.Save(feature); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(int id) { var feature = _featureRepository.Get(id); var viewModel = new FeatureModel { Id = id, Name = feature.Name, FeatureStatus = feature.FeatureSwitchStatus, FeatureStatuses = new SelectList(new List<FeatureSwitchStatus>{ FeatureSwitchStatus.Disabled, FeatureSwitchStatus.EnabledForAll, FeatureSwitchStatus.EnabledForAuthenticatedUsers, FeatureSwitchStatus.EnabledForSpecifiedUsersOrGroups }) }; return View(viewModel); }