Class FormulaFunctionsWithContext<T>
The context supplied while executing formulas that also has a custom context item the formula can execute against
Inheritance
FormulaFunctionsWithContext<T>
Inherited Members
StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object, object)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Assembly: LemonEdge.API.dll
Syntax
public class FormulaFunctionsWithContext<T> : FormulaFunctionsWithUpdater, IFormulaFunctionsWithContext<T>, IFormulaFunctionsWithContext, IFormulaFunctions
Type Parameters
Name |
Description |
T |
The context supplied while executing formulas that also has a custom context item the formula can execute against |
Constructors
FormulaFunctionsWithContext(IEntityRetriever, IReadOnlyCache, UserInfo, T, IFormulaFunctionsServiceContext)
Creates a new formula functions for helping with custom formulas as a context to operate against
Declaration
public FormulaFunctionsWithContext(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, T item, IFormulaFunctionsServiceContext services)
Parameters
Properties
ChangedItemType
Declaration
public ContextChangedItemType ChangedItemType { get; set; }
Property Value
Item
Required when MyItem is an unknown type to the user but definitely an IBaseEntity
Declaration
public IBaseEntity Item { get; }
Property Value
MyItem
The context item the system is running this formula with
Declaration
public T MyItem { get; init; }
Property Value
PropertyChangedAlias
Declaration
public string PropertyChangedAlias { get; set; }
Property Value
PropertyChangedItem
Declaration
public IBaseEntity PropertyChangedItem { get; set; }
Property Value
PropertyChangedName
Declaration
public string PropertyChangedName { get; set; }
Property Value
Methods
CreateFormulaContext(Type)
Declaration
protected override FormulaFunctions CreateFormulaContext(Type ofType)
Parameters
Type |
Name |
Description |
Type |
ofType |
|
Returns
Overrides
GetAnswerTotal(string)
Returns the total of answers against this object for the specified question type
Declaration
[FormulaFunction(Name = "GetAnswerTotal", Type = "Main", Description = "Returns the total of answers against this object for the specified question type.", Params = "1. The name of the question type.", ParamCount = 1, IsAsync = true)]
public Task<decimal> GetAnswerTotal(string forQuestionTypeName)
Parameters
Type |
Name |
Description |
string |
forQuestionTypeName |
The name of the question type
|
Returns
Type |
Description |
Task<decimal> |
The total of answers against this object for the specified question type
|
GetContextType(EntityDescriptor)
Returns the exact type of the FormulaFunctionsWithContext that would be created for working against this type of
entity, so the the context item can be parsed and evaluated correctly against formula code referencing
MyItem
Declaration
public static Type GetContextType(EntityDescriptor desc)
Parameters
Type |
Name |
Description |
EntityDescriptor |
desc |
The type of entity a formula will be running against
|
Returns
Type |
Description |
Type |
The exact type of the FormulaFunctionsWithContext that would be created for working against this type of
entity, so the the context item can be parsed and evaluated correctly against formula code referencing
MyItem
|
GetValue(string)
Returns the value of the specified property
If this is against the item, it is just the value of the property against the item.
If this is against a query result, the property name is the column name of the value to return
Declaration
[FormulaFunction(Name = "GetValue", Type = "Main", Description = "Returns the value of the specified property. Can also be called with GetValusAs<Type>.", Params = "1. The name of the property to return from the item, or the column name of a sql wrapper result.", ParamCount = 1, IsAsync = false)]
public virtual object GetValue(string propertyName)
Parameters
Type |
Name |
Description |
string |
propertyName |
The name of the property to return from the item, or the column name of a sql wrapper result
|
Returns
Type |
Description |
object |
The value of the specified property
|
GetValue<T2>(string)
Declaration
public virtual T2 GetValue<T2>(string propertyName)
Parameters
Type |
Name |
Description |
string |
propertyName |
|
Returns
Type Parameters
ItemAs<T1>()
Declaration
Returns
Type Parameters
SetBusy(string)
Allow override in ui, but don't do anything in services
Declaration
public virtual void SetBusy(string label)
Parameters
Type |
Name |
Description |
string |
label |
|
SetExtendedPropertyValue(IBaseEntity, string, string, object)
Declaration
[FormulaFunction(Name = "SetExtendedPropertyValue", Type = "Main", Description = "Sets the value for the specified item for a extended custom property of it.", Params = "1. The main item to update an extended property for.\r\n2. The name of the extended custom entity.\r\n3. The name of the of the property on the extended type to update.\r\n4. The value to update the property with.", ParamCount = 4, IsAsync = true)]
public virtual Task<IBaseEntity> SetExtendedPropertyValue(IBaseEntity item, string extendedTypeName, string extendedPropertyName, object value)
Parameters
Returns
StopBusy()
Allow override in ui, but don't do anything in services
Declaration
public virtual void StopBusy()
TestEvents()
Declaration
Returns
Implements
Extension Methods
See Also