public IActionResult Options(string className) { return(new ContentResult() { Content = JsonSerializer.Serialize(OverviewViewModel.create(_storage, className, true).Options), ContentType = "application/json" }); }
public IActionResult Index(string className) { var o = _storage.getClasses().Find(c => c.Name.ToLower().Equals(className.ToLower())); Template.RegisterSafeType(typeof(OverviewViewModel), new[] { "Class", "Elements", "Options" }); Template.RegisterSafeType(typeof(OptionViewModel), new[] { "Id", "Value" }); var v = OverviewViewModel.create(_storage, className); var template = Template.Parse(o.OverviewTemplate); var render = template.Render(Hash.FromAnonymousObject(new { Model = v })); return(new ContentResult() { Content = render, ContentType = "text/html" }); }