public IActionResult ExistingPost(ParseExistingViewModel model)
        {
            var service = new PolicyApplicationService(this.hostingEnvironment.WebRootPath);
            var policy  = service.CreateFromExisting(model);

            return(this.RedirectToRoute("editPolicy", new { id = policy.Id }));
        }
        public IActionResult NewPolicy()
        {
            var service = new PolicyApplicationService(this.hostingEnvironment.WebRootPath);
            var policy  = service.CreateBlank();

            return(this.RedirectToRoute("editPolicy", new { id = policy.Id }));
        }
        public ActionResult Save([FromBody] SavePolicyVersionModel model)
        {
            var service = new PolicyApplicationService(this.hostingEnvironment.WebRootPath);

            service.Update(model.PolicyId, model.PolicyText);

            return(this.Ok());
        }
        public JsonResult Get(string id)
        {
            var service = new PolicyApplicationService(this.hostingEnvironment.WebRootPath);
            var json    = service.GetPolicyViewModel(id);

            var parsed = JObject.Parse(json);

            return(this.Json(parsed));
        }