Test additional content header

EvaluationScopeT Class

Provides the base class from which the use-case specific calculations classes can be derived.

Definition

Namespace: Fluent.Calculations.Primitives
Assembly: Fluent.Calculations.Primitives (in Fluent.Calculations.Primitives.dll) Version: 1.1.0-aplha
public abstract class EvaluationScope<T> : EvaluationScope, 
	IEvaluationScope<T>, IEvaluationScope
where T : class, new(), IValueProvider
Inheritance
Object    EvaluationScope    EvaluationScopeT
Implements
IEvaluationScope, IEvaluationScopeT

Type Parameters

T
Type of the result value class.

Remarks

Create inhertited classes from this base class to define, run and retrieve a result of your calculations.

Calculation

Your class inheriting from EvaluationScope<T> is a logical unit to compute desired result. Place lambda expressions,
input parameters or constants of types derived from Value or IValue in your derived implementation.

Examples

Inheriting from EvaluationScope<T>, where T is a result class type returned by ToResult() method.

C#
public class ExampleCalculation : EvaluationScope<Number>
{
public ExampleCalculation() : base(new EvaluationOptions { AlwaysReadNamesFromExpressions = true }) { }
public override Number Return() => Number.Of(0);
}
Learn more

Constructors

EvaluationScopeT Initializes a new instance of the EvaluationScopeT.
EvaluationScopeT(EvaluationOptions) Initializes a new instance of the EvaluationScopeT class with custom options.
EvaluationScopeT(FuncEvaluationScopeT, T) Initializes a new instance of the EvaluationScopeT class with standalone labda expression.
EvaluationScopeT(String) Initializes a new instance of the EvaluationScopeT class with standalone lambda expression.

Methods

ClearCacheForce clearing cached evaluation results.
(Inherited from EvaluationScope)
EvaluateTValue(ExpressionFuncTValue, String, String)Evaluates an expression and captures it's arguments.
(Inherited from EvaluationScope)
EvaluateTCase, TValue(FuncSwitchExpressionTCase, TValueResultEvaluator, String)Evaluates switch expression and captures it's values as arguments.
(Inherited from EvaluationScope)
ReturnOverride to implement the final calculation step.
ToResultRuns and return result from implemented calculation.

See Also