public PrecompiledView(string path, string masterPath, Type compiled, Func <string, Type> compiledTypeLookup, bool runViewStart, PrecompiledViewEngine viewEngine) { Path = path; MasterPath = masterPath; Compiled = compiled; CompiledTypeLookup = compiledTypeLookup; RunViewStart = runViewStart; ViewEngine = viewEngine; }
public PrecompiledView(string path, string masterPath, Type compiled, Func<string, Type> compiledTypeLookup, Func<WebViewPage, string, WebPageRenderingBase> startPageGetter, PrecompiledViewEngine viewEngine) { Path = path; MasterPath = masterPath; Compiled = compiled; CompiledTypeLookup = compiledTypeLookup; StartPageGetter = startPageGetter; ViewEngine = viewEngine; }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalFilters.Filters.Add(new HandleErrorAttribute()); RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); RouteTable.Routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); var precompiledViewEngine = new PrecompiledViewEngine(typeof(HomeController).Assembly); precompiledViewEngine.ViewThunk += path => { throw new Exception("Couldn't find precompiled view: " + path); }; ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(precompiledViewEngine); }
public PrecompilationVirtualPathFactory(PrecompiledViewEngine precompiled = null, RoslynRazorViewEngine runtime = null) { _precompiled = precompiled; _runtime = runtime; }