RazorEngine


IRazorEngineService

Defined in RazorEngine.dll.

Defines the required contract for implementing a template service. The main API for running templates.

Instance members

Instance memberDescription
AddTemplate(key, templateSource)
Signature: (key:ITemplateKey * templateSource:ITemplateSource) -> unit
Modifiers: abstract

Adds a given template to the template manager as dynamic template.

Compile(key, modelType)
Signature: (key:ITemplateKey * modelType:Type) -> unit
Modifiers: abstract

Compiles the specified template and caches it.

GetKey(name, resolveType, context)
Signature: (name:string * resolveType:ResolveType * context:ITemplateKey) -> ITemplateKey
Modifiers: abstract

Gets a given key from the ITemplateManager implementation. See ITemplateManager.GetKey.

Returns:

IsTemplateCached(key, modelType)
Signature: (key:ITemplateKey * modelType:Type) -> bool
Modifiers: abstract

Checks if a given template is already cached.

Returns:

Run(...)
Signature: (key:ITemplateKey * writer:TextWriter * modelType:Type * model:obj * viewBag:DynamicViewBag) -> unit
Modifiers: abstract

Runs the given cached template.

RunCompile(...)
Signature: (key:ITemplateKey * writer:TextWriter * modelType:Type * model:obj * viewBag:DynamicViewBag) -> unit
Modifiers: abstract

Runs the given cached template. When the cache does not contain the template it will be compiled and cached beforehand.

Fork me on GitHub