public ActionResult Create(string id, string command, Endpoint model)
 {
     var service = reader.GetService(command);
     if (!service.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.Name = service.ConfigSet.Name;
     ViewBag.System = service.ConfigSet.System;
     ViewBag.ServiceId = service.Id; 
     var endpoint=reader.CreateEndpoint(service, model.Name);
     return RedirectToAction("Details", new {id = "edit", item = endpoint.Id});
 }
 public ActionResult Delete(string id, Endpoint model)
 {
     var endpoint = reader.GetEndpoint(id);
     reader.DeleteEndpoint(endpoint);
     return RedirectToAction("Details", new { id = "edit", item = endpoint.ServiceNameId });
 }