Class DataContextScriptExtensions
class providing extension methods for backwards compatibility.
Inheritance
Inherited Members
Namespace: TimeCockpit.Data
Assembly: TimeCockpit.Data.dll
Syntax
public static class DataContextScriptExtensions
Methods
ExecuteScript(DataContext, ExecutionInfo)
Creates a new script context and executes a script.
Declaration
public static void ExecuteScript(this DataContext dataContext, ExecutionInfo script)
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | DataContext to execute script agains. |
ExecutionInfo | script | the script source to execute. |
ExecuteScript(DataContext, ExecutionInfo, Stream)
Creates a new script context and executes a script.
Declaration
public static void ExecuteScript(this DataContext dataContext, ExecutionInfo script, Stream outputStream)
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | DataContext to execute script agains. |
ExecutionInfo | script | the script source to execute. |
System.IO.Stream | outputStream | stream accepting output. |
ExecuteScriptFromResource(DataContext, Assembly, String, Stream)
Executes the script from resource.
Declaration
public static void ExecuteScriptFromResource(this DataContext dataContext, Assembly assembly, string resourceName, Stream outputStream = null)
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | The data context. |
System.Reflection.Assembly | assembly | The assembly. |
System.String | resourceName | Name of the resource. |
System.IO.Stream | outputStream | stream accepting output. |
ExecuteScriptReturnOutput(DataContext, ExecutionInfo)
Creates a new script context and executes a script.
Declaration
public static string ExecuteScriptReturnOutput(this DataContext dataContext, ExecutionInfo script)
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | DataContext to execute script agains. |
ExecutionInfo | script | the script source to execute. |
Returns
Type | Description |
---|---|
System.String | returns the script output |
GetFunctionScriptResult<T>(DataContext, ExecutionInfo, String, Object[], Stream)
Gets the script resource.
Declaration
public static T GetFunctionScriptResult<T>(this DataContext dataContext, ExecutionInfo script, string functionName, object[] parameters, Stream outputStream = null)
where T : class
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | The data context. |
ExecutionInfo | script | The script. |
System.String | functionName | The name of the function to execute. |
System.Object[] | parameters | A list of parameters for the function. |
System.IO.Stream | outputStream | stream accepting output. |
Returns
Type | Description |
---|---|
T | returns a new script result. |
Type Parameters
Name | Description |
---|---|
T | Type of the result |
GetScriptResult(DataContext, ExecutionInfo, Stream)
Gets the script resource.
Declaration
public static ScriptResult GetScriptResult(this DataContext dataContext, ExecutionInfo script, Stream outputStream = null)
Parameters
Type | Name | Description |
---|---|---|
DataContext | dataContext | The data context. |
ExecutionInfo | script | The script. |
System.IO.Stream | outputStream | stream accepting output. |
Returns
Type | Description |
---|---|
ScriptResult | returns a new script result. |