public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations) { string theme = null; if (context.Values.TryGetValue(THEME_KEY, out theme)) { IEnumerable<string> themeLocations = new[] { $"/Themes/{theme}/{{1}}/{{0}}.cshtml", $"/Themes/{theme}/Shared/{{0}}.cshtml" }; string tenant; if (context.Values.TryGetValue(TENANT_KEY, out tenant)) { themeLocations = ExpandTenantLocations(tenant, themeLocations); } viewLocations = themeLocations.Concat(viewLocations); } return viewLocations; }
public static string GetJson(HttpResponse response) { var b = new { Title = "Professional C# 6", Publisher = "Wrox Press", Author = "Christian Nagel" }; string json = JsonConvert.SerializeObject(b); response.ContentType = "application/json"; return json; }