RazorEngine


RazorEngineService

Defined in RazorEngine.dll.

Defines a template service and the main API for running templates. Implements the IRazorEngineService interface.

Instance members

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

Adds a given template to the ITemplateManager as dynamic template.

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

Compiles the specified template and caches it.

GetKey(cacheName, resolveType, context)
Signature: (cacheName: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 in the ICachingProvider.

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.

Static members

Static memberDescription
Create()
Signature: unit -> IRazorEngineService

Creates a new IRazorEngineService instance.

Returns:

Create(config)
Signature: config:ITemplateServiceConfiguration -> IRazorEngineService

Creates a new IRazorEngineService instance with the given configuration.

Returns:

Fork me on GitHub