public ActionResult Create(string id, ServiceHostParameter model)
 {
     var serviceHost = reader.GetServiceHost(id);
     if (!serviceHost.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.HostId = serviceHost.Id;
     var param = reader.CreateServiceHostParameter(serviceHost, model.Name, model.IsSecureString, model.ItemValue, model.IsEnvironmental);
     return RedirectToAction("Details", "ServiceHosts", new { id = serviceHost.Id });
 }
        public ActionResult Delete(string id, ServiceHostParameter model)
        {
            var par = reader.GetHostParameter(Server.UrlDecode(id));
            if (!par.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
            ViewBag.HostId = par.ServiceHost.Id;
            par.Description = model.Description;
            par.IsEnvironmental = model.IsEnvironmental;    
           reader.DeleteServiceHostParameter(par);

            return RedirectToAction("Details", "ServiceHosts", new { id = par.ServiceHost.Id });
        }
        public ActionResult Details(string id, ServiceHostParameter model)
        {
            var par = reader.GetHostParameter(Server.UrlDecode(id));
            if (!par.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
            ViewBag.HostId = par.ServiceHost.Id;
            par.Description = model.Description;
            par.IsEnvironmental = model.IsEnvironmental;
            if (model.ItemValue != par.ItemValue)
            {
                if (model.ItemValue.IsNullOrWhiteSpace())
                    par.ItemValue = null;
                else
                    par.SetValue(model.ItemValue);
            }
            reader.UpdateHostParameter(par);

            return RedirectToAction("Details", "ServiceHosts", new { id = par.ServiceHost.Id });
        }