TdsQueryEngineOptions Class
Configures the built-in TDS query engine.
public sealed class TdsQueryEngineOptionsRemarks
Configure the instance fully before passing it to TdsQueryEngine.CreateQueryHandler. The collections are snapshotted at that point, so later additions are ignored, and mutating them afterwards races with queries running on other connections.
Constructors
| Name | Description |
|---|---|
| TdsQueryEngineOptions() | Initializes a new instance of the TdsQueryEngineOptions class with the default scalar functions. |
TdsQueryEngineOptions()
TdsQueryEngineOptions.csInitializes a new instance of the TdsQueryEngineOptions class with the default scalar functions.
[RequiresDynamicCode("The query engine compiles LINQ expression trees and creates projection types and generic instantiations at run time.")]
[RequiresUnreferencedCode("The query engine translates SQL into LINQ expression trees and reads the members of the query roots and stored procedures with reflection.")]
public TdsQueryEngineOptions()Properties
| Name | Description |
|---|---|
| IsAuthorized | Gets or sets the authorization callback used for stored procedures and query roots. |
| MaterializeAsync | Gets or sets the materializer used to enumerate translated text queries. |
| NotAuthorizedErrorFactory | Gets or sets the factory used to build permission-denied errors. |
| QueryRoots | Gets the query roots available to SQL text queries. |
| ScalarFunctions | Gets the scalar SQL function mappings used by the query translator. |
| StoredProcedures | Gets the stored procedures available to RPC requests. |
| XmlSchemaCollections | Gets the XML schema collections available to typed XML casts. |
IsAuthorized
TdsQueryEngineOptions.csGets or sets the authorization callback used for stored procedures and query roots.
public TdsQueryEngineAuthorizationHandler IsAuthorized { get; set; }Property value
MaterializeAsync
TdsQueryEngineOptions.csGets or sets the materializer used to enumerate translated text queries.
public TdsQueryMaterializer MaterializeAsync { get; set; }Property value
NotAuthorizedErrorFactory
TdsQueryEngineOptions.csGets or sets the factory used to build permission-denied errors.
public Func<TdsQueryContext, TdsQueryEngineResourceKind, string, TdsQueryError> NotAuthorizedErrorFactory { get; set; }QueryRoots
TdsQueryEngineOptions.csGets the query roots available to SQL text queries.
public Collection<TdsQueryRoot> QueryRoots { get; }Property value
ScalarFunctions
TdsQueryEngineOptions.csGets the scalar SQL function mappings used by the query translator.
public IDictionary<string, TdsQueryScalarFunction> ScalarFunctions { get; }Property value
StoredProcedures
TdsQueryEngineOptions.csGets the stored procedures available to RPC requests.
public IDictionary<string, Delegate> StoredProcedures { get; }Property value
Remarks
Stored procedure delegates can declare parameters matching RPC parameters, plus optional injected TdsQueryContext and CancellationToken parameters.
XmlSchemaCollections
TdsQueryEngineOptions.csGets the XML schema collections available to typed XML casts.
public IDictionary<string, XmlSchemaSet> XmlSchemaCollections { get; }Property value
Methods
| Name | Description |
|---|---|
| AddQueryRoot<T>(string, Func<TdsQueryContext, IQueryable<T>>) | Adds a query root factory resolved from the current query request context. |
| AddScalarFunction(string, TdsQueryScalarFunction) | Adds or replaces a scalar SQL function mapping. |
| AddXmlSchemaCollection(string, string) | Adds or replaces an XML schema collection from an XSD definition string. |
| AddXmlSchemaCollection(string, XmlSchemaSet) | Adds or replaces an XML schema collection. |
AddQueryRoot<T>(string, Func<TdsQueryContext, IQueryable<T>>)
TdsQueryEngineOptions.csAdds a query root factory resolved from the current query request context.
public TdsQueryEngineOptions AddQueryRoot<T>(string name, Func<TdsQueryContext, IQueryable<T>> queryFactory)AddScalarFunction(string, TdsQueryScalarFunction)
TdsQueryEngineOptions.csAdds or replaces a scalar SQL function mapping.
public TdsQueryEngineOptions AddScalarFunction(string name, TdsQueryScalarFunction function)AddXmlSchemaCollection overloads
AddXmlSchemaCollection(string, string)
TdsQueryEngineOptions.csAdds or replaces an XML schema collection from an XSD definition string.
public TdsQueryEngineOptions AddXmlSchemaCollection(string name, string schemaDefinition)AddXmlSchemaCollection(string, XmlSchemaSet)
TdsQueryEngineOptions.csAdds or replaces an XML schema collection.
public TdsQueryEngineOptions AddXmlSchemaCollection(string name, XmlSchemaSet schemaSet)