Click or drag to resize

DataContextCustomTableOperationTokens Property

Gets dictionary of per-model custom tokens to use with AmendExpressionAttribute values for TableOperationsT in this DataContext .

Namespace: GSF.Web.Model
Assembly: GSF.Web (in GSF.Web.dll) Version: 2.4.207-beta
Syntax
public Dictionary<Type, IEnumerable<KeyValuePair<string, string>>> CustomTableOperationTokens { get; }
View Source

Property Value

DictionaryType, IEnumerableKeyValuePairString, String
Remarks
The returned dictionary can be used to apply run-time tokens to any defined AmendExpressionAttribute values, for example, given the following amendment expression applied to a modeled class:
C#
[AmendExpression("TOP {count}", 
    TargetExpression = TargetExpression.FieldList,
    AffixPosition = AffixPosition.Prefix,
    StatementTypes = StatementTypes.SelectSet)]]
public class MyTable
{
    string MyField;
}
The per-model key/value pairs could be set as follows at run-time:
C#
int count = 200;
dataContext.CustomTableOperationTokens[typeof(MyTable)] = new[] { new KeyValuePair<string, string>("{count}", $"{count}") };
See Also