ScriptCodeUtils
Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class ScriptCodeUtils
Methods
CodeBlock(ScriptContext, String)
View Source
Declaration
[Obsolete("Use CodeSharpPage")]
public static SharpPage CodeBlock(this ScriptContext context, string code)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
CodeSharpPage(ScriptContext, String)
View Source
Declaration
public static SharpPage CodeSharpPage(this ScriptContext context, string code)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
RenderCode(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static string RenderCode(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
RenderCodeAsync(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static async Task<string> RenderCodeAsync(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
ParseCode(ScriptContext, String)
View Source
Declaration
public static JsBlockStatement ParseCode(this ScriptContext context, string code)
Returns
ServiceStack.Script.JsBlockStatement
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
ParseCode(ScriptContext, ReadOnlyMemory<Char>)
View Source
Declaration
public static JsBlockStatement ParseCode(this ScriptContext context, ReadOnlyMemory<char> code)
Returns
ServiceStack.Script.JsBlockStatement
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
ReadOnlyMemory<System.Char> | code |
EnsureReturn(String)
View Source
Declaration
public static string EnsureReturn(string code)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | code |
EvaluateCode<T>(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static T EvaluateCode<T>(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
Type Parameters
T
EvaluateCode(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static object EvaluateCode(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
EvaluateCodeAsync<T>(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static async Task<T> EvaluateCodeAsync<T>(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
System.Threading.Tasks.Task<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
Type Parameters
T
EvaluateCodeAsync(ScriptContext, String, Dictionary<String, Object>)
View Source
Declaration
public static async Task<object> EvaluateCodeAsync(this ScriptContext context, string code, Dictionary<string, object> args = null)
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.String | code |
System.Collections.Generic.Dictionary<System.String,System.Object> | args |
ParseCodeScriptBlock(ReadOnlyMemory<Char>, ScriptContext, out PageBlockFragment)
View Source
Declaration
public static ReadOnlyMemory<char> ParseCodeScriptBlock(this ReadOnlyMemory<char> literal, ScriptContext context, out PageBlockFragment blockFragment)
Returns
ReadOnlyMemory<System.Char>
Parameters
Type | Name |
---|---|
ReadOnlyMemory<System.Char> | literal |
ServiceStack.Script.ScriptContext | context |
ServiceStack.Script.PageBlockFragment | blockFragment |