public ActionResult Create(string id, string command, ServiceDescription model)
 {
     var cs = reader.GetConfigSet(command);
     if (!cs.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.Name = cs.Name;
     ViewBag.System = cs.System;
     reader.CreateService(cs, model.Name);
     return RedirectToAction("Details", "ConfigSet", new { name = cs.Name, system = cs.System });
 }
 public ActionResult Details(string id, string item, ServiceDescription model)
 {
     var service = reader.GetService(item);
     ViewBag.ServiceHosts = service.ConfigSet.ServiceHosts;
     if (!service.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     service.ClientEndpointValue = model.ClientEndpointValue;
     service.ServiceHost = service.ConfigSet.ServiceHosts.SingleOrDefault(sh => sh.Id == model.ServiceHostId);
     service.ServiceHostId = model.ServiceHostId;
     service.Description = model.Description;
     if (service.ServiceHost.IsNull()) service.ServiceHostId = null;
     reader.UpdateService(service);
     return RedirectToAction("Details", "ConfigSet", new { name = service.ConfigSet.Name, system = service.ConfigSet.System });
 }
 public ActionResult DeleteService(string id, ServiceDescription model)
 {
     var service = reader.GetService(id);
     var route = new { name = service.ConfigSet.Name, system = service.ConfigSet.System };
     reader.DeleteService(service);
     return RedirectToAction("Details", "ConfigSet", route);
 }