Class BlendTransactionContext
The custom context for evaluating formulas against that are configured in the BlendingTransaction settings (FormulaForValue)
See https://web.lemonedge.com/help/blend-transactions/ for more information
Inheritance
Inherited Members
Namespace: LemonEdge.API.Processors.Transactional
Assembly: API.dll
Syntax
public class BlendTransactionContext : FormulaFunctionsWithContext<IBlendTransaction>, IFormulaFunctionsWithContextItem, IFormulaFunctions
Constructors
BlendTransactionContext(IEntityRetriever, IReadOnlyCache, UserInfo, BlendTransactionProcessorExtender)
Creates a new blending transaction context for evaluating formulas against blending transaction configuration
Declaration
public BlendTransactionContext(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, BlendTransactionProcessorExtender extender)
Parameters
Type | Name | Description |
---|---|---|
IEntityRetriever | retriever | A context for retrieving data from the system with |
IReadOnlyCache | cache | A local current cache |
UserInfo | user | The currently logged in user |
BlendTransactionProcessorExtender | extender | The type of blending transaction process algorithm being used |
Properties
EffectiveDate
The effective date the algorithm is currently running to
Declaration
public DateTimeOffset EffectiveDate { get; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
Extender
The type of blending transaction process algorithm being used
Declaration
public BlendTransactionProcessorExtender Extender { get; }
Property Value
Type | Description |
---|---|
BlendTransactionProcessorExtender |
FinancialDate
The financial date the algorithm is currently running to
Declaration
public DateTimeOffset FinancialDate { get; }
Property Value
Type | Description |
---|---|
System.DateTimeOffset |
InstrumentID
An optional argument for the current instrument id the algorithm is running against
Declaration
public Guid? InstrumentID { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
StartDate
The optional start date for this run of the algorithm
Declaration
public DateTimeOffset? StartDate { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTimeOffset> |
Methods
GetValues(String, Nullable<Guid>)
A function for returning the collection of results for the specified value and optional current instrument
Declaration
public Task<IEnumerable<ITransactionAggregateResult>> GetValues(string valueName, Guid? instrumentID)
Parameters
Type | Name | Description |
---|---|---|
System.String | valueName | The aggregated values to return specified from the Name, or ISQLWrapper result |
System.Nullable<System.Guid> | instrumentID | An optional instrument to only return the aggregated values for |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ITransactionAggregateResult>> | A list of aggregated transaction values according to the setup in the IBlendingTran |
Init(SQLWrapperInterpretor, ISQLWrapperResult, Nullable<DateTimeOffset>, DateTimeOffset, DateTimeOffset)
Initializes the context with all the current states for evaluation against a current blended transaction formula
Declaration
public void Init(SQLWrapperInterpretor sqlWrapper, ISQLWrapperResult result, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
Type | Name | Description |
---|---|---|
SQLWrapperInterpretor | sqlWrapper | The currently executing source sql wrapper |
ISQLWrapperResult | result | The current result row for creating a transaction |
System.Nullable<System.DateTimeOffset> | startDate | |
System.DateTimeOffset | effectiveDate | |
System.DateTimeOffset | financialDate |
Init(IBlendTransactionInstrumentSet, Nullable<DateTimeOffset>, DateTimeOffset, DateTimeOffset)
Initializes the context with all the current states for evaluation against a current blended transaction formula
Declaration
public void Init(IBlendTransactionInstrumentSet instrumentSet, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
Type | Name | Description |
---|---|---|
IBlendTransactionInstrumentSet | instrumentSet | The instrument set blended transaction setup this is being evaluated against |
System.Nullable<System.DateTimeOffset> | startDate | The optional start date for this run of the algorithm |
System.DateTimeOffset | effectiveDate | The effective date the algorithm is currently running to |
System.DateTimeOffset | financialDate | The financial date the algorithm is currently running to |
ReturnSQLWrapperResult(String)
Returns the result of the specified column name for the executed sql wrapper of this blended transaction
Declaration
public object ReturnSQLWrapperResult(string columnName)
Parameters
Type | Name | Description |
---|---|---|
System.String | columnName | The name of the column to return the value of |
Returns
Type | Description |
---|---|
System.Object | The result of the specified column name for the executed sql wrapper of this blended transaction |