public ActionResult Edit(string id, string item, EndpointParameter model) { var parameter = reader.GetEnpointParameter(item); ViewBag.Trail = parameter.GetTrail(); if (!parameter.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset"); parameter.ItemValue = TrimParameter(model); parameter.Description = model.Description; reader.UpdateEndpointParameter(parameter); return View(parameter); }
private static string TrimParameter(EndpointParameter model) { if (model.ItemValue.IsNullOrEmpty()) return null; return model.ItemValue.TrimEnd(); }