EvalScriptBlock
Special block which evaluates the rendered body as a ServiceStack Template
Usages: {{#eval}}emit {{evaluateBodyOfArg}} at {{now}} {{/eval}}
{{#eval {scopeArg:1} }} emit {{evaluateBodyOfArg}} at {{now}} with {{scopeArg}} {{/eval}}
{{#eval {htmlDecode:true} }} emit htmldecoded {{evaluateBodyOfArg}} at {{now}} {{/eval}}
{{#eval {use:{methods:'ServiceStackScripts',plugins:['MarkdownScriptPlugin']} }} emit {{evaluateBodyOfArg}} at {{now}} in new context {{/eval}}
{{#eval { use:{context:true} } }} emit {{evaluateBodyOfArg}} in host context {{/eval}}
Assembly: ServiceStack.Common.dll
View Source
public class EvalScriptBlock : ScriptBlock, IConfigureScriptContext
Properties
Name
View Source
public override string Name { get; }
Body
View Source
public override ScriptLanguage Body { get; }
Inherited Properties
Body
Parse Body using Specified Language. Uses host language if unspecified.
View Source
public virtual ScriptLanguage Body { get; }
Context
View Source
public ScriptContext Context { get; set; }
Name
View Source
public abstract string Name { get; }
Pages
View Source
public ISharpPages Pages { get; set; }
Methods
WriteAsync(ScriptScopeContext, PageBlockFragment, CancellationToken)
View Source
public override async Task WriteAsync(ScriptScopeContext scope, PageBlockFragment block, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageBlockFragment | block |
System.Threading.CancellationToken | token |
Inherited Methods
AssertWithinMaxQuota(Int32)
View Source
protected int AssertWithinMaxQuota(int value)
Returns
System.Int32
Parameters
Type | Name |
---|---|
System.Int32 | value |
CanExportScopeArgs(Object)
View Source
protected bool CanExportScopeArgs(object element)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.Object | element |
Configure(ScriptContext)
View Source
public void Configure(ScriptContext context)
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
GetCallTrace(PageBlockFragment)
View Source
protected virtual string GetCallTrace(PageBlockFragment fragment)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.PageBlockFragment | fragment |
GetElseCallTrace(PageElseBlock)
View Source
protected virtual string GetElseCallTrace(PageElseBlock fragment)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.PageElseBlock | fragment |
WriteAsync(ScriptScopeContext, JsStatement[], String, CancellationToken)
View Source
protected virtual async Task WriteAsync(ScriptScopeContext scope, JsStatement[] body, string callTrace, CancellationToken cancel)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.JsStatement[] | body |
System.String | callTrace |
System.Threading.CancellationToken | cancel |
WriteAsync(ScriptScopeContext, PageBlockFragment, CancellationToken)
View Source
public abstract Task WriteAsync(ScriptScopeContext scope, PageBlockFragment block, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageBlockFragment | block |
System.Threading.CancellationToken | token |
WriteAsync(ScriptScopeContext, PageFragment[], String, CancellationToken)
View Source
protected virtual async Task WriteAsync(ScriptScopeContext scope, PageFragment[] body, string callTrace, CancellationToken cancel)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageFragment[] | body |
System.String | callTrace |
System.Threading.CancellationToken | cancel |
WriteBodyAsync(ScriptScopeContext, PageBlockFragment, CancellationToken)
View Source
protected virtual async Task WriteBodyAsync(ScriptScopeContext scope, PageBlockFragment fragment, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageBlockFragment | fragment |
System.Threading.CancellationToken | token |
WriteElseAsync(ScriptScopeContext, PageElseBlock, CancellationToken)
View Source
protected virtual async Task WriteElseAsync(ScriptScopeContext scope, PageElseBlock fragment, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageElseBlock | fragment |
System.Threading.CancellationToken | token |
WriteElseAsync(ScriptScopeContext, PageElseBlock[], CancellationToken)
View Source
protected async Task WriteElseAsync(ScriptScopeContext scope, PageElseBlock[] elseBlocks, CancellationToken cancel)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.PageElseBlock[] | elseBlocks |
System.Threading.CancellationToken | cancel |