RazorTemplateEngine.ParseTemplate Method

Definition

Overloads

ParseTemplate(ITextBuffer)
ParseTemplate(ITextBuffer, Nullable<CancellationToken>)

Parses the template specified by the TextBuffer and returns it's result

ParseTemplate(TextReader, Nullable<CancellationToken>)
ParseTemplate(TextReader, String)

ParseTemplate(ITextBuffer)

public:
 Microsoft::AspNetCore::Razor::ParserResults ^ ParseTemplate(Microsoft::AspNetCore::Razor::Text::ITextBuffer ^ input);
public Microsoft.AspNetCore.Razor.ParserResults ParseTemplate (Microsoft.AspNetCore.Razor.Text.ITextBuffer input);
member this.ParseTemplate : Microsoft.AspNetCore.Razor.Text.ITextBuffer -> Microsoft.AspNetCore.Razor.ParserResults
Public Function ParseTemplate (input As ITextBuffer) As ParserResults

Parameters

input
ITextBuffer

Returns

Applies to

ParseTemplate(ITextBuffer, Nullable<CancellationToken>)

Parses the template specified by the TextBuffer and returns it's result

public:
 Microsoft::AspNetCore::Razor::ParserResults ^ ParseTemplate(Microsoft::AspNetCore::Razor::Text::ITextBuffer ^ input, Nullable<System::Threading::CancellationToken> cancelToken);
public Microsoft.AspNetCore.Razor.ParserResults ParseTemplate (Microsoft.AspNetCore.Razor.Text.ITextBuffer input, System.Threading.CancellationToken? cancelToken);
member this.ParseTemplate : Microsoft.AspNetCore.Razor.Text.ITextBuffer * Nullable<System.Threading.CancellationToken> -> Microsoft.AspNetCore.Razor.ParserResults
Public Function ParseTemplate (input As ITextBuffer, cancelToken As Nullable(Of CancellationToken)) As ParserResults

Parameters

input
ITextBuffer

The input text to parse.

cancelToken
Nullable<CancellationToken>

A token used to cancel the parser.

Returns

The resulting parse tree.

Remarks

IMPORTANT: This does NOT need to be called before GeneratedCode! GenerateCode will automatically parse the document first.

The cancel token provided can be used to cancel the parse. However, please note that the parse occurs _synchronously_, on the callers thread. This parameter is provided so that if the caller is in a background thread with a CancellationToken, it can pass it along to the parser.

Applies to

ParseTemplate(TextReader, Nullable<CancellationToken>)

public:
 Microsoft::AspNetCore::Razor::ParserResults ^ ParseTemplate(System::IO::TextReader ^ input, Nullable<System::Threading::CancellationToken> cancelToken);
public Microsoft.AspNetCore.Razor.ParserResults ParseTemplate (System.IO.TextReader input, System.Threading.CancellationToken? cancelToken);
member this.ParseTemplate : System.IO.TextReader * Nullable<System.Threading.CancellationToken> -> Microsoft.AspNetCore.Razor.ParserResults
Public Function ParseTemplate (input As TextReader, cancelToken As Nullable(Of CancellationToken)) As ParserResults

Parameters

input
TextReader

Returns

Applies to

ParseTemplate(TextReader, String)

public:
 Microsoft::AspNetCore::Razor::ParserResults ^ ParseTemplate(System::IO::TextReader ^ input, System::String ^ sourceFileName);
public Microsoft.AspNetCore.Razor.ParserResults ParseTemplate (System.IO.TextReader input, string sourceFileName);
member this.ParseTemplate : System.IO.TextReader * string -> Microsoft.AspNetCore.Razor.ParserResults
Public Function ParseTemplate (input As TextReader, sourceFileName As String) As ParserResults

Parameters

input
TextReader
sourceFileName
String

Returns

Applies to