Table of Contents

Class ExpressionHelper

Namespace
Ecng.Compilation.Expressions
Assembly
Ecng.Compilation.dll

Extension class for ExpressionFormula<TResult>.

[CLSCompliant(false)]
public static class ExpressionHelper
Inheritance
ExpressionHelper
Inherited Members

Properties

Functions

Available functions.

public static IEnumerable<string> Functions { get; }

Property Value

IEnumerable<string>

Methods

Compile<TResult>(ICompiler, ICompilerContext, Func<Assembly, string, Type>, string, ICompilerCache, CancellationToken)

Compile mathematical formula.

public static Task<ExpressionFormula<TResult>> Compile<TResult>(this ICompiler compiler, ICompilerContext context, Func<Assembly, string, Type> getType, string expression, ICompilerCache cache = null, CancellationToken cancellationToken = default)

Parameters

compiler ICompiler

ICompiler.

context ICompilerContext

ICompilerContext

getType Func<Assembly, string, Type>

Function to get type from the assembly.

expression string

Text expression.

cache ICompilerCache

ICompilerCache.

cancellationToken CancellationToken

CancellationToken.

Returns

Task<ExpressionFormula<TResult>>

Compiled mathematical formula.

Type Parameters

TResult

Result type.

Compile<TResult>(ICompiler, ICompilerContext, string, ICompilerCache, CancellationToken)

Compile mathematical formula.

public static Task<ExpressionFormula<TResult>> Compile<TResult>(this ICompiler compiler, ICompilerContext context, string expression, ICompilerCache cache = null, CancellationToken cancellationToken = default)

Parameters

compiler ICompiler

ICompiler.

context ICompilerContext

ICompilerContext

expression string

Text expression.

cache ICompilerCache

ICompilerCache.

cancellationToken CancellationToken

CancellationToken.

Returns

Task<ExpressionFormula<TResult>>

Type Parameters

TResult

GetVariables(string)

Get variables from the expression.

public static string[] GetVariables(string expression)

Parameters

expression string

Text expression.

Returns

string[]

Variables.