Click or drag to resize

RazorCoreEngine Methods

The RazorCoreEngine type exposes the following members.

Methods
 NameDescription
Public methodStatic memberCheckSyntax Compile 'script' for a syntax check only: nothing is cached or persisted. A compilation failure throws the same TemplateCompilationException as Compile. On success, returns the compiler warnings located in the script and the generated C# code (to map RazorEngineCompilerError.Line). RazorEngineCore drops the diagnostics of a successful compilation, so the generated code is analyzed again with Roslyn (no emit).
Public methodStatic memberCompile Compile 'script' under 'key' (no-op if already cached). When cacheDir is set, a persisted assembly is reused (and invalidated by lastModification), mirroring GetGlobalAssemblyCache/SaveAssemblyInCache.
Public methodStatic memberIsTemplateCached Returns true if a compiled template is cached under the given key
Public methodStatic memberRun Run the compiled template cached under 'key' with the given model and ViewBag, and return the rendered result
Top
See Also