PageResult
Assembly: ServiceStack.Common.dll
View Source
public class PageResult : IPageResult, IStreamWriterAsync, IHasOptions, IDisposable
Properties
Page
The Page to Render
View Source
public SharpPage Page { get; }
CodePage
The Code Page to Render
View Source
public SharpCodePage CodePage { get; }
LayoutPage
Use specified Layout
View Source
public SharpPage LayoutPage { get; set; }
Layout
Use Layout with specified name
View Source
public string Layout { get; set; }
NoLayout
Render without any Layout
View Source
public bool NoLayout { get; set; }
Model
Extract Model Properties into Scope Args
View Source
public object Model { get; set; }
Args
Add additional Args available to all pages
View Source
public Dictionary<string, object> Args { get; set; }
ScriptMethods
Add additional script methods available to all pages
View Source
public List<ScriptMethods> ScriptMethods { get; set; }
TemplateFilters
View Source
[Obsolete("Use ScriptMethods")]
public List<ScriptMethods> TemplateFilters { get; }
ScriptBlocks
Add additional script blocks available to all pages
View Source
public List<ScriptBlock> ScriptBlocks { get; set; }
TemplateBlocks
View Source
[Obsolete("Use ScriptBlocks")]
public List<ScriptBlock> TemplateBlocks { get; }
Partials
Add additional partials available to all pages
View Source
public Dictionary<string, SharpPage> Partials { get; set; }
Options
Return additional HTTP Headers in HTTP Requests
View Source
public IDictionary<string, string> Options { get; set; }
ContentType
Specify the Content-Type of the Response
View Source
public string ContentType { get; set; }
PageTransformers
Transform the Page output using a chain of stream transformers
View Source
public List<Func<Stream, Task<Stream>>> PageTransformers { get; set; }
OutputTransformers
Transform the entire output using a chain of stream transformers
View Source
public List<Func<Stream, Task<Stream>>> OutputTransformers { get; set; }
FilterTransformers
Available transformers that can transform context filter stream outputs
View Source
public Dictionary<string, Func<Stream, Task<Stream>>> FilterTransformers { get; set; }
ExcludeFiltersNamed
Don't allow access to specified filters
View Source
public HashSet<string> ExcludeFiltersNamed { get; }
LastFilterError
The last error thrown by a filter
View Source
public Exception LastFilterError { get; set; }
LastFilterStackTrace
The StackTrace where the Last Error Occured
View Source
public string[] LastFilterStackTrace { get; set; }
AssignExceptionsTo
What argument errors should be binded to
View Source
public string AssignExceptionsTo { get; set; }
CatchExceptionsIn
What argument captured errors should be binded to
View Source
public string CatchExceptionsIn { get; set; }
SkipFilterExecution
Whether to skip execution of all page filters and just write page string fragments
View Source
public bool SkipFilterExecution { get; set; }
SkipExecutingFiltersIfError
Overrides Context to specify whether to Ignore or Continue executing filters on error
View Source
public bool? SkipExecutingFiltersIfError { get; set; }
RethrowExceptions
Whether to always rethrow Exceptions
View Source
public bool RethrowExceptions { get; set; }
HaltExecution
Immediately halt execution of the page
View Source
public bool HaltExecution { get; set; }
DisableBuffering
Whether to disable buffering output and render directly to OutputStream
View Source
public bool DisableBuffering { get; set; }
ReturnValue
The Return value of the page (if any)
View Source
public ReturnValue ReturnValue { get; set; }
StackDepth
The Current StackDepth
View Source
public int StackDepth { get; }
PartialStackDepth
The Current StackDepth of rendering partials
View Source
public int PartialStackDepth { get; }
Evaluations
Can be used to track number of Evaluations
View Source
public long Evaluations { get; }
Context
View Source
public ScriptContext Context { get; }
Format
View Source
public PageFormat Format { get; }
VirtualPath
View Source
public string VirtualPath { get; }
ResultOutput
View Source
public string ResultOutput { get; }
Result
View Source
public string Result { get; }
Methods
AssertNextEvaluation()
View Source
public void AssertNextEvaluation()
AssertNextPartial()
View Source
public void AssertNextPartial()
ResetIterations()
View Source
public void ResetIterations()
AssignArgs(Dictionary<String, Object>)
View Source
public PageResult AssignArgs(Dictionary<string, object> args)
Returns
ServiceStack.Script.PageResult
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
WriteToAsync(Stream, CancellationToken)
View Source
public async Task WriteToAsync(Stream responseStream, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.IO.Stream | responseStream |
System.Threading.CancellationToken | token |
WritePageFragmentAsync(ScriptScopeContext, PageFragment, CancellationToken)
View Source
public async Task WritePageFragmentAsync(ScriptScopeContext scope, PageFragment fragment, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageFragment | fragment |
System.Threading.CancellationToken | token |
WriteStatementsAsync(ScriptScopeContext, IEnumerable<JsStatement>, String, CancellationToken)
View Source
public Task WriteStatementsAsync(ScriptScopeContext scope, IEnumerable<JsStatement> blockStatements, string callTrace, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Collections.Generic.IEnumerable<ServiceStack.Script.JsStatement> | blockStatements |
System.String | callTrace |
System.Threading.CancellationToken | token |
WriteStatementsAsync(ScriptScopeContext, IEnumerable<JsStatement>, CancellationToken)
View Source
public async Task WriteStatementsAsync(ScriptScopeContext scope, IEnumerable<JsStatement> blockStatements, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Collections.Generic.IEnumerable<ServiceStack.Script.JsStatement> | blockStatements |
System.Threading.CancellationToken | token |
ShouldSkipFilterExecution(PageVariableFragment)
View Source
public bool ShouldSkipFilterExecution(PageVariableFragment var)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.PageVariableFragment | var |
ShouldSkipFilterExecution(PageFragment)
View Source
public bool ShouldSkipFilterExecution(PageFragment fragment)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.PageFragment | fragment |
ShouldSkipFilterExecution(JsStatement)
View Source
public bool ShouldSkipFilterExecution(JsStatement statement)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Script.JsStatement | statement |
Init()
View Source
public async Task<PageResult> Init()
Returns
System.Threading.Tasks.Task<ServiceStack.Script.PageResult>
WritePageAsync(SharpPage, SharpCodePage, ScriptScopeContext, CancellationToken)
View Source
public Task WritePageAsync(SharpPage page, SharpCodePage codePage, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.SharpPage | page |
ServiceStack.Script.SharpCodePage | codePage |
ServiceStack.Script.ScriptScopeContext | scope |
System.Threading.CancellationToken | token |
WritePageAsync(SharpPage, ScriptScopeContext, CancellationToken)
View Source
public async Task WritePageAsync(SharpPage page, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.SharpPage | page |
ServiceStack.Script.ScriptScopeContext | scope |
System.Threading.CancellationToken | token |
WriteCodePageAsync(SharpCodePage, ScriptScopeContext, CancellationToken)
View Source
public async Task WriteCodePageAsync(SharpCodePage page, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.SharpCodePage | page |
ServiceStack.Script.ScriptScopeContext | scope |
System.Threading.CancellationToken | token |
WriteVarAsync(ScriptScopeContext, PageVariableFragment, CancellationToken)
View Source
public async Task WriteVarAsync(ScriptScopeContext scope, PageVariableFragment var, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageVariableFragment | var |
System.Threading.CancellationToken | token |
ParseJsExpression(ScriptScopeContext, ReadOnlySpan<Char>, out JsToken)
View Source
public ReadOnlySpan<char> ParseJsExpression(ScriptScopeContext scope, ReadOnlySpan<char> literal, out JsToken token)
Returns
ReadOnlySpan<System.Char>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ReadOnlySpan<System.Char> | literal |
ServiceStack.Script.JsToken | token |
TryGetBlock(String)
View Source
public ScriptBlock TryGetBlock(string name)
Returns
ServiceStack.Script.ScriptBlock
Parameters
Type | Name |
---|---|
System.String | name |
GetBlock(String)
View Source
public ScriptBlock GetBlock(string name)
Returns
ServiceStack.Script.ScriptBlock
Parameters
Type | Name |
---|---|
System.String | name |
CreateScope(Stream)
View Source
public ScriptScopeContext CreateScope(Stream outputStream = null)
Returns
ServiceStack.Script.ScriptScopeContext
Parameters
Type | Name |
---|---|
System.IO.Stream | outputStream |
EvaluateIfToken(Object, ScriptScopeContext)
View Source
public object EvaluateIfToken(object value, ScriptScopeContext scope)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | value |
ServiceStack.Script.ScriptScopeContext | scope |
Execute()
View Source
public PageResult Execute()
Returns
ServiceStack.Script.PageResult
Clone(SharpPage)
View Source
public PageResult Clone(SharpPage page)
Returns
ServiceStack.Script.PageResult
Parameters
Type | Name |
---|---|
ServiceStack.Script.SharpPage | page |
Dispose()
View Source
public void Dispose()