Skip to main content

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​

ServiceStack.Script.SharpPage

Parameters​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode

CodeSharpPage(ScriptContext, String)​

View Source​
Declaration
public static SharpPage CodeSharpPage(this ScriptContext context, string code)
Returns​

ServiceStack.Script.SharpPage

Parameters​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode

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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode

ParseCode(ScriptContext, ReadOnlyMemory<Char>)​

View Source​
Declaration
public static JsBlockStatement ParseCode(this ScriptContext context, ReadOnlyMemory<char> code)
Returns​

ServiceStack.Script.JsBlockStatement

Parameters​
TypeName
ServiceStack.Script.ScriptContextcontext
ReadOnlyMemory<System.Char>code

EnsureReturn(String)​

View Source​
Declaration
public static string EnsureReturn(string code)
Returns​

System.String

Parameters​
TypeName
System.Stringcode

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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ServiceStack.Script.ScriptContextcontext
System.Stringcode
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​
TypeName
ReadOnlyMemory<System.Char>literal
ServiceStack.Script.ScriptContextcontext
ServiceStack.Script.PageBlockFragmentblockFragment