Click or drag to resize

RazorCoreEngine Class

RazorEngineCore-backed replacement for the bits of the Antaris fork that Seal uses: a string-keyed compiled-template cache with optional on-disk persistence (RazorCacheDirectory). Reached only via RazorHelper when UseRazorCore is enabled.
Inheritance Hierarchy
SystemObject
  Seal.HelpersRazorCoreEngine

Namespace: Seal.Helpers
Assembly: SealLibrary (in SealLibrary.dll) Version: 10.2.0.0+da7797057e6d5ef3b02633ee3e36991921c726cb
Syntax
C#
public static class RazorCoreEngine

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