Search Results for

    Show / Hide Table of Contents

    Interface IScriptHelper

    Namespace: LemonEdge.API.Core.Scripting
    Assembly: LemonEdge.API.dll
    Syntax
    public interface IScriptHelper

    Methods

    EvaluateFormulaType(string, Type, object)

    Evaluates the specified formula and returns the result as the specified resultType

    The script can take a context that can be referenced in the formula, and must be of type contextType

    Declaration
    Task<object> EvaluateFormulaType(string formula, Type contextType, object context)
    Parameters
    Type Name Description
    string formula

    The formula, or script, to be parsed and evaluated

    Type contextType

    The type of the context object that can be referenced by the formula or script

    object context

    The context object that can be referenced by the formula or script

    Returns
    Type Description
    Task<object>

    The result of evaluating the specified formula against the provuded context

    EvaluateFormulaType(Type, string, Type, object)

    Evaluates the specified formula and returns the result as the specified resultType

    The script can take a context that can be referenced in the formula, and must be of type contextType

    Declaration
    Task<object> EvaluateFormulaType(Type resultType, string formula, Type contextType, object context)
    Parameters
    Type Name Description
    Type resultType

    The type of the result returned from this formula or script

    string formula

    The formula, or script, to be parsed and evaluated

    Type contextType

    The type of the context object that can be referenced by the formula or script

    object context

    The context object that can be referenced by the formula or script

    Returns
    Type Description
    Task<object>

    The result of evaluating the specified formula against the provuded context

    EvaluateFormula<T>(string, Type, object, bool)

    Evaluates the specified formula and returns the result as the specified T

    The script can take a context that can be referenced in the formula, and must be of type contextType

    Declaration
    Task<T> EvaluateFormula<T>(string formula, Type contextType, object context, bool compileOnly = false)
    Parameters
    Type Name Description
    string formula

    The formula, or script, to be parsed and evaluated

    Type contextType

    The type of the context object that can be referenced by the formula or script

    object context

    The context object that can be referenced by the formula or script

    bool compileOnly

    Whether to just compile the script for the purpose of initialisation, or also execute it.

    Returns
    Type Description
    Task<T>

    The result of evaluating the specified formula against the provided context

    Type Parameters
    Name Description
    T

    The type of the result returned from this formula or script

    IsValid<T>(string, Type)

    Throws an error with any compilation exceptions

    Declaration
    bool IsValid<T>(string formula, Type contextType)
    Parameters
    Type Name Description
    string formula
    Type contextType
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.