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
TThe 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
Properties
Name
Gets the name of this context value.
public string Name { get; }
Property Value
Value
Gets the static value associated with this context value.
public object Value { get; }
Property Value
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
inputTThe root context object (ignored).
funcFunc<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
inputTThe root context object (ignored).
funcFunc<string, T, Task<object>>Async function to resolve variables (ignored).