Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 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);
 }