TemplateService
Defined in RazorEngine.dll.
Defines a template service.
Constructors
Constructor | Description |
new(config)
Signature: config:ITemplateServiceConfiguration -> unit
|
Initialises a new instance of TemplateService |
new()
Signature: unit -> unit
|
Initialises a new instance of TemplateService. |
Instance members
Instance member | Description |
AddNamespace(ns)
Signature: ns:string -> unit
Modifiers: abstract |
Adds a namespace that will be imported into the template. |
Compile(...)
Signature: (razorTemplate:string * modelType:Type * cacheName:string) -> unit
Modifiers: abstract |
Compiles the specified template. |
Configuration()
Signature: unit -> ITemplateServiceConfiguration
Modifiers: abstract |
Gets the template service configuration. |
CreateExecuteContext(viewBag)
Signature: viewBag:DynamicViewBag -> ExecuteContext
Modifiers: abstract |
Creates a new ExecuteContext for tracking templates. |
CreateTemplate(...)
Signature: (razorTemplate:string * templateType:Type * model:obj) -> ITemplate
Modifiers: abstract |
Creates an instance of ITemplate from the specified string template. |
CreateTemplates(...)
Signature: (razorTemplates:IEnumerable<string> * templateTypes:IEnumerable<Type> * models:IEnumerable<obj> * parallel:bool) -> IEnumerable<ITemplate>
Modifiers: abstract |
|
CreateTemplateType(...)
Signature: (razorTemplate:string * modelType:Type) -> Type
Modifiers: abstract |
Creates a Type that can be used to instantiate an instance of a template. |
CreateTemplateTypes(...)
Signature: (razorTemplates:IEnumerable<string> * modelTypes:IEnumerable<Type> * parallel:bool) -> IEnumerable<Type>
Modifiers: abstract |
|
Dispose()
Signature: unit -> unit
Modifiers: abstract |
Releases managed resources used by this instance. |
EncodedStringFactory()
Signature: unit -> IEncodedStringFactory
Modifiers: abstract |
Gets the encoded string factory. |
GetTemplate(...)
Signature: (razorTemplate:string * model:obj * cacheName:string) -> ITemplate
Modifiers: abstract |
Gets an instance of the template using the cached compiled type, or compiles the template type if it does not exist in the cache. |
GetTemplates(...)
Signature: (razorTemplates:IEnumerable<string> * models:IEnumerable<obj> * cacheNames:IEnumerable<string> * parallel:bool) -> IEnumerable<ITemplate>
Modifiers: abstract |
|
HasTemplate(cacheName)
Signature: cacheName:string -> bool
Modifiers: abstract |
Returns whether or not a template by the specified name has been created already. |
Parse(...)
Signature: (razorTemplate:string * model:obj * viewBag:DynamicViewBag * cacheName:string) -> string
Modifiers: abstract |
Parses and returns the result of the specified string template. |
Parse(...)
Signature: (razorTemplate:string * model:obj * viewBag:DynamicViewBag * cacheName:string) -> string
Modifiers: abstract Type parameters: 'T |
Parses and returns the result of the specified string template. |
ParseMany(...)
Signature: (razorTemplates:IEnumerable<string> * models:IEnumerable<obj> * viewBags:IEnumerable<DynamicViewBag> * cacheNames:IEnumerable<string> * parallel:bool) -> IEnumerable<string>
Modifiers: abstract |
|
RemoveTemplate(cacheName)
Signature: cacheName:string -> bool
Modifiers: abstract |
Remove a template by the specified name from the cache. |
Resolve(cacheName, model)
Signature: (cacheName:string * model:obj) -> ITemplate
Modifiers: abstract |
Resolves the template with the specified name. |
Run(cacheName, model, viewBag)
Signature: (cacheName:string * model:obj * viewBag:DynamicViewBag) -> string
Modifiers: abstract |
Runs the template with the specified cacheName. |
Run(template, viewBag)
Signature: (template:ITemplate * viewBag:DynamicViewBag) -> string
Modifiers: abstract |
Runs the specified template and returns the result. |