RazorEngine


DelegateTemplateManager

Defined in RazorEngine.dll.

Provides an ITemplateManager that supports delegated template resolution.

Constructors

ConstructorDescription
new()
Signature: unit -> unit

Creates a new DelegateTemplateManager which throws an exception when we try to resolve something (supports dynamically adding templates).

new(resolver)
Signature: resolver:Func<string,string> -> unit

Initialises a new instance of DelegateTemplateResolver.

Instance members

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

Dynamically add a new template.

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

Creates a template-key instance (see also ITemplateManager.GetKey).

Returns: The template-key.

RemoveDynamic(key)
Signature: key:ITemplateKey -> unit

Use this API to remove a dynamic template. WARNING: using this API doesn't really help you if the template is already cached. So will need to invalidate the cache as well.

Resolve(key)
Signature: key:ITemplateKey -> ITemplateSource
Modifiers: abstract

Resolves the template content with the specified name.

Returns: The template content.

Fork me on GitHub