RazorEngine


TemplateBase

Defined in RazorEngine.dll.
Provides a base implementation of a template. NOTE: This class is not serializable to prevent subtle errors in user IActivator implementations which would break the sandbox. (because executed in the wrong AppDomain)

Constructors

ConstructorDescription
new()
Signature: unit -> unit
Initialises a new instance of TemplateBase.

Instance members

Instance memberDescription
CurrentWriter()
Signature: unit -> TextWriter
Gets the current writer.
DefineSection(name, action)
Signature: (name:string * action:Action) -> unit
Defines a section that can written out to a layout.
Execute()
Signature: unit -> unit
Modifiers: abstract
Executes the compiled template.
Include(name, model, modelType)
Signature: (name:string * model:obj * modelType:Type) -> TemplateWriter
Modifiers: abstract
Includes the template with the specified name.
IsSectionDefined(name)
Signature: name:string -> bool
Modifiers: abstract
Determines if the section with the specified name has been defined.
Layout()
Signature: unit -> string
Gets or sets the layout template name.
Raw(rawString)
Signature: rawString:string -> IEncodedString
Returns the specified string as a raw string. This will ensure it is not encoded.
RazorEngine()
Signature: unit -> IRazorEngineService
Modifiers: abstract
Gets or sets the current IRazorEngineService instance.
RenderBody()
Signature: unit -> TemplateWriter
Renders the body of the template.
RenderSection(name, isRequired)
Signature: (name:string * isRequired:bool) -> TemplateWriter
Modifiers: abstract
Renders the section with the specified name.
ResolveUrl(path)
Signature: path:string -> string
Modifiers: abstract
Resolves the specified path
set_InternalTemplateService(value)
Signature: value:IInternalTemplateService -> unit
Modifiers: abstract
SetModel(model)
Signature: model:obj -> unit
Modifiers: abstract
Set the current model.
TemplateService()
Signature: unit -> ITemplateService
Modifiers: abstract
Gets or sets the template service.
ViewBag()
Signature: unit -> obj
Gets the viewbag that allows sharing state between layout and child templates.
Write(value)
Signature: value:obj -> unit
Modifiers: abstract
Writes the specified object to the result.
Write(helper)
Signature: helper:TemplateWriter -> unit
Modifiers: abstract
Writes the specified template helper result.
WriteAttribute(...)
Signature: (name:string * prefix:PositionTagged<string> * suffix:PositionTagged<string> * values:AttributeValue []) -> unit
Modifiers: abstract
WriteAttributeTo(...)
Signature: (writer:TextWriter * name:string * prefix:PositionTagged<string> * suffix:PositionTagged<string> * values:AttributeValue []) -> unit
Modifiers: abstract
WriteLiteral(literal)
Signature: literal:string -> unit
Modifiers: abstract
Writes the specified string to the result.
WriteLiteralTo(writer, literal)
Signature: (writer:TextWriter * literal:string) -> unit
Modifiers: abstract
Writes a string literal to the specified TextWriter.
WriteTo(writer, value)
Signature: (writer:TextWriter * value:obj) -> unit
Modifiers: abstract
Writes the specified object to the specified TextWriter.
WriteTo(writer, helper)
Signature: (writer:TextWriter * helper:TemplateWriter) -> unit
Modifiers: abstract
Writes the specfied template helper result to the specified writer.
Fork me on GitHub