EachScriptBlock
Handlebars.js like each block Usages: {{#each customers}} {{Name}} {{/each}} {{#each customers}} {{it.Name}} {{/each}} {{#each num in numbers}} {{num}} {{/each}} {{#each num in [1,2,3]}} {{num}} {{/each}} {{#each numbers}} {{it}} {{else}} no numbers {{/each}} {{#each numbers}} {{it}} {{else if letters != null}} has letters {{else}} no numbers {{/each}} {{#each n in numbers where n > 5}} {{it}} {{else}} no numbers > 5 {{/each}} {{#each n in numbers where n > 5 orderby n skip 1 take 2}} {{it}} {{else}} no numbers > 5 {{/each}}
Assembly: ServiceStack.Common.dll
View Source
public class EachScriptBlock : ScriptBlock, IConfigureScriptContext
Properties
Name
View Source
public override string Name { 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 |