CommandFactory
Ecng.Data
Builds and caches schema-driven DatabaseCommand instances for the standard CRUD operations (the path that goes through QueryProvider). Extracted from Database so the command-construction concern is unit-testable in isolation and the (already large) Database file does not own one more thing.
メソッド
GetCommandAsync
public ValueTask<DatabaseCommand> GetCommandAsync(Schema meta, SqlCommandTypes type, IReadOnlyList<SchemaColumn> keyColumns, IReadOnlyList<SchemaColumn> valueColumns, CancellationToken cancellationToken)
result = commandFactory.GetCommandAsync(meta, type, keyColumns, valueColumns, cancellationToken)
Returns a cached DatabaseCommand for the given schema and CRUD operation, building one on first access. Parameter binding is derived from the rendered SQL (matched by @param regex) against the column metadata.