|
TableOperationsT(AdoDataConnection, ActionException, IEnumerableKeyValuePairString, String) Constructor
|
Namespace: GSF.Data.ModelAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.258-beta+f8b6aa3dbfe0b4cc2b0b0760dd5d2a3dd4f59d09
Syntaxpublic TableOperations(
AdoDataConnection connection,
Action<Exception> exceptionHandler,
IEnumerable<KeyValuePair<string, string>> customTokens = null
)
Public Sub New (
connection As AdoDataConnection,
exceptionHandler As Action(Of Exception),
Optional customTokens As IEnumerable(Of KeyValuePair(Of String, String)) = Nothing
)
public:
TableOperations(
AdoDataConnection^ connection,
Action<Exception^>^ exceptionHandler,
IEnumerable<KeyValuePair<String^, String^>>^ customTokens = nullptr
)
new :
connection : AdoDataConnection *
exceptionHandler : Action<Exception> *
?customTokens : IEnumerable<KeyValuePair<string, string>>
(* Defaults:
let _customTokens = defaultArg customTokens null
*)
-> TableOperationsGSF.Data.Model.TableOperations = function(connection, exceptionHandler, customTokens);
View SourceParameters
- connection AdoDataConnection
- AdoDataConnection instance to use for database operations.
- exceptionHandler ActionException
- Delegate to handle table operation exceptions.
- customTokens IEnumerableKeyValuePairString, String (Optional)
- Custom run-time tokens to apply to any modeled AmendExpressionAttribute values.
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | connection cannot be null. |
Remarks
When exception handler is provided, table operations will not throw exceptions for database calls, any
encountered exceptions will be passed to handler for processing.
The customTokens 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:
[AmendExpression("TOP {count}",
TargetExpression = TargetExpression.FieldList,
AffixPosition = AffixPosition.Prefix,
StatementTypes = StatementTypes.SelectSet)]]
The
customTokens key/value pairs could be set as follows at run-time:
int count = 200;
customTokens = new[] { new KeyValuePair<string, string>("{count}", $"{count}") };
See Also