Table of Contents

Class LocalContextValue<T>

Namespace
Albatross.Expression.Context
Assembly
Albatross.Expression.dll

Context value that holds a static, pre-computed value. Does not depend on the input context and always returns the same value.

public class LocalContextValue<T> : IContextValue<T>

Type Parameters

T

The type of the root context object.

Inheritance
LocalContextValue<T>
Implements
Inherited Members
Extension Methods

Constructors

LocalContextValue(string, object)

Initializes a new instance of the LocalContextValue class with a fixed value.

public LocalContextValue(string name, object value)

Parameters

name string

The name of this context value.

value object

The static value to return when evaluated.

Properties

Name

Gets the name of this context value.

public string Name { get; }

Property Value

string

Value

Gets the static value associated with this context value.

public object Value { get; }

Property Value

object

Methods

GetValue(T, Func<string, T, object>)

Returns the static value, ignoring the input context and function parameters.

public object GetValue(T input, Func<string, T, object> func)

Parameters

input T

The root context object (ignored).

func Func<string, T, object>

Function to resolve variables (ignored).

Returns

object

The static value stored in this context value.

GetValueAsync(T, Func<string, T, Task<object>>)

Asynchronously returns the static value, ignoring the input context and function parameters.

public Task<object> GetValueAsync(T input, Func<string, T, Task<object>> func)

Parameters

input T

The root context object (ignored).

func Func<string, T, Task<object>>

Async function to resolve variables (ignored).

Returns

Task<object>

A completed task containing the static value.