Interface IQueryStructure
Dynamic query structure interface
Namespace: XData.Mapping.Dynamic
Assembly: XData.docfx.dll
Syntax
public interface IQueryStructure
Methods
| Improve this Doc View SourceAddFilters(String, Expression<Func<IInnerFilterAdapter, IFilterDescription>>[])
Add dynamic filters
Declaration
IQueryStructure AddFilters(string alias, params Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Source alias |
| Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] | filters | Dynamic filters |
Returns
| Type | Description |
|---|---|
| IQueryStructure |
Call(IDataScope, Variable[])
Dynamic procedure call with no result set
Declaration
IDataQuery Call(IDataScope dataScope, params Variable[] variables)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataScope | dataScope | Data scope |
| Variable[] | variables | Data object variables |
Returns
| Type | Description |
|---|---|
| IDataQuery | Procedure call result |
Remarks
Hint: Use variables as parameter values
Hint: To pass binary parameters use Base64 string value
Hint: To pass UDT parameters use Xml-serialized value of mapped type
See Also
Call<TResult>(IDataScope, String, Variable[])
Dynamic procedure call
Declaration
IDataQuery<TResult> Call<TResult>(IDataScope dataScope, string resultSetName, params Variable[] variables)
where TResult : class
Parameters
| Type | Name | Description |
|---|---|---|
| IDataScope | dataScope | Data scope |
| String | resultSetName | Base result set name |
| Variable[] | variables | Data object variables |
Returns
| Type | Description |
|---|---|
| IDataQuery<TResult> | Procedure call result |
Type Parameters
| Name | Description |
|---|---|
| TResult | Dynamic query result type |
Remarks
Hint: Use variables as parameter values
Hint: To pass binary parameters use Base64 string value
Hint: To pass UDT parameters use Xml-serialized value of mapped type
See Also
Column<TResult>(String, Expression<Func<IQueryStructureAdapter, TResult>>)
Dynamic query hidden property mapping
Declaration
IQueryStructure Column<TResult>(string name, Expression<Func<IQueryStructureAdapter, TResult>> mapper)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | Hidden property name |
| Expression<Func<IQueryStructureAdapter, TResult>> | mapper | Property mapping expression |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TResult |
See Also
| Improve this Doc View SourceDataTable(String, String, Expression<Func<IInnerFilterAdapter, IFilterDescription>>[])
Dynamic query table mapping
Declaration
IQueryStructure DataTable(string name, string alias, params Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | Table name |
| String | alias | Table alias |
| Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] | filters | Filters and links applied to table |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
See Also
| Improve this Doc View SourceDistinct()
Dynamic query distinct modificator
Declaration
IQueryStructure Distinct()
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Hint(String, String, HintType)
Dynamic query data source hint
Declaration
IQueryStructure Hint(string alias, string hint, HintType hintType = HintType.Select)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Data source alias |
| String | hint | Hint |
| HintType | hintType | Hint type |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
See Also
| Improve this Doc View SourceInnerView(String, Type, Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[])
Dynamic query inner view mapping
Declaration
IQueryStructure InnerView(string alias, Type innerViewType, params Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Inner view alias |
| Type | innerViewType | Inner view statically mapped type |
| Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[] | filters | Filters and links applied to inner view |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
See Also
| Improve this Doc View SourceInnerView<TInnerView>(String, Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[])
Dynamic query inner view mapping
Declaration
IQueryStructure InnerView<TInnerView>(string alias, params Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[] filters)
where TInnerView : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Inner view alias |
| Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[] | filters | Filters and links applied to inner view |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TInnerView | Inner view statically mapped type |
See Also
| Improve this Doc View SourceInnerView<TInnerView>(String, IQueryDescription<TInnerView>, Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[])
Dynamic query inner view mapping
Declaration
IQueryStructure InnerView<TInnerView>(string alias, IQueryDescription<TInnerView> sub, params Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[] filters)
where TInnerView : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Inner view alias |
| IQueryDescription<TInnerView> | sub | Inner view query structure |
| Expression<Func<ISubqueryLinkAdapter<TInnerView>, IFilterDescription>>[] | filters | Filters and links applied to inner view |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TInnerView |
See Also
Limit(Int32)
Dynamic query limit count modificator
Declaration
IQueryStructure Limit(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | count | Limit records count |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Map<TResult>(Expression<Func<IRepositoryStructureAdapter<TResult>, TResult>>, Expression<Func<IRepositoryStructureAdapter<TResult>, IExternalLinkDefinition>>[])
Dynamic repository mapping
Declaration
IRepositoryDescription<TResult> Map<TResult>(Expression<Func<IRepositoryStructureAdapter<TResult>, TResult>> mapper, params Expression<Func<IRepositoryStructureAdapter<TResult>, IExternalLinkDefinition>>[] externalLinks)
where TResult : class, IDataObject, new()
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<IRepositoryStructureAdapter<TResult>, TResult>> | mapper | Mapping expression |
| Expression<Func<IRepositoryStructureAdapter<TResult>, IExternalLinkDefinition>>[] | externalLinks | External link descriptions |
Returns
| Type | Description |
|---|---|
| IRepositoryDescription<TResult> | Dynamic repository description |
Type Parameters
| Name | Description |
|---|---|
| TResult | Dynamic repository type |
See Also
Parameter<T>(String, Int32, String, DbType, Expression<Func<IProcedureParameterAdapter, IProcedureParameterFlag>>[])
Dynamic query procedure parameter mapping
Declaration
IQueryStructure Parameter<T>(string alias, int order, string binding, DbType type, params Expression<Func<IProcedureParameterAdapter, IProcedureParameterFlag>>[] attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Procedure alias |
| Int32 | order | Parameter order |
| String | binding | Parameter value binding |
| DbType | type | Parameter SQL data type |
| Expression<Func<IProcedureParameterAdapter, IProcedureParameterFlag>>[] | attributes | Parameter mapping attributes |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| T | Parameter data type |
Procedure(String, String, ProcedureType, Expression<Func<IInnerFilterAdapter, IFilterDescription>>[])
Dynamic query procedure mapping
Declaration
IQueryStructure Procedure(string alias, string name, ProcedureType type, params Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Procedure alias |
| String | name | Procedure name |
| ProcedureType | type | Procedure type |
| Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] | filters | Filters and links applied to table |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
See Also
| Improve this Doc View SourceReturn<T>(String, String, Int32, Expression<Func<IQueryStructureAdapter, T>>)
Dynamic query procedure result set mapping
Declaration
IQueryStructure Return<T>(string alias, string name, int order, Expression<Func<IQueryStructureAdapter, T>> mapper = null)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Procedure alias |
| String | name | Result set name |
| Int32 | order | Result set order |
| Expression<Func<IQueryStructureAdapter, T>> | mapper | Result set mapper |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| T | Parameter data type |
Select<TResult>()
Dynamic query result mapping using statically mapped data
Declaration
IQueryDescription<TResult> Select<TResult>()
where TResult : class, IDataObject, new()
Returns
| Type | Description |
|---|---|
| IQueryDescription<TResult> | Dynamic query description |
Type Parameters
| Name | Description |
|---|---|
| TResult | Dynamic query result type |
See Also
Select<TResult>(Expression<Func<IQueryStructureAdapter, TResult>>)
Dynamic query result mapping
Declaration
IQueryDescription<TResult> Select<TResult>(Expression<Func<IQueryStructureAdapter, TResult>> mapper)
where TResult : class
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<IQueryStructureAdapter, TResult>> | mapper | Mapping expression |
Returns
| Type | Description |
|---|---|
| IQueryDescription<TResult> | Dynamic query description |
Type Parameters
| Name | Description |
|---|---|
| TResult | Dynamic query result type |
See Also
Skip(Int32)
Dynamic query skip count modificator
Declaration
IQueryStructure Skip(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | count | Skip records count |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Subquery(String, Type, String, DataGrouping, Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[])
Dynamic query subquery mapping
Declaration
IQueryStructure Subquery(string alias, Type subqueryType, string property, DataGrouping grouping = DataGrouping.None, params Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Subquery alias |
| Type | subqueryType | Subquery statically mapped type |
| String | property | Subquery selected property |
| DataGrouping | grouping | Subquery selected property aggregate function |
| Expression<Func<ISubqueryLinkAdapter, IFilterDescription>>[] | filters | Filters and links applied to subquery |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
See Also
| Improve this Doc View SourceSubquery<TSubquery>(String, Expression<Func<TSubquery, Object>>, DataGrouping, Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[])
Dynamic query subquery mapping
Declaration
IQueryStructure Subquery<TSubquery>(string alias, Expression<Func<TSubquery, object>> property, DataGrouping grouping = DataGrouping.None, params Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[] filters)
where TSubquery : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Subquery alias |
| Expression<Func<TSubquery, Object>> | property | Subquery selected property expression |
| DataGrouping | grouping | Subquery selected property aggregate function |
| Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[] | filters | Filters and links applied to subquery |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TSubquery | Subquery statically mapped type |
See Also
| Improve this Doc View SourceSubquery<TSubquery>(String, IQueryDescription<TSubquery>, String, DataGrouping, Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[])
Dynamic query subquery mapping
Declaration
IQueryStructure Subquery<TSubquery>(string alias, IQueryDescription<TSubquery> sub, string property, DataGrouping grouping = DataGrouping.None, params Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[] filters)
where TSubquery : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Subquery alias |
| IQueryDescription<TSubquery> | sub | Subquery query structure |
| String | property | Subquery selected property |
| DataGrouping | grouping | Subquery selected property aggregate function |
| Expression<Func<ISubqueryLinkAdapter<TSubquery>, IFilterDescription>>[] | filters | Filters and links applied to subquery |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TSubquery |
See Also
TempTable(String, String, Expression<Func<IInnerFilterAdapter, IFilterDescription>>[])
Dynamic query temporary table mapping
Declaration
IQueryStructure TempTable(string name, string alias, params Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | Temporary table data variable name |
| String | alias | Temporary table data source alias |
| Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] | filters | Filters and links applied to temporary table data source |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Remarks
Data passed to query as variable with name equals name of temporary table data source
Variable value must to be DataTable
See Also
| Improve this Doc View SourceWith<TRoot>(String, IQueryDescription<TRoot>, Expression<Func<IQueryWithAdapter<TRoot>, IQueryWithFlag>>[])
Dynamic query Common-Table-Expression (WITH) subquery mapping
Declaration
IQueryStructure With<TRoot>(string alias, IQueryDescription<TRoot> sub, params Expression<Func<IQueryWithAdapter<TRoot>, IQueryWithFlag>>[] attributes)
where TRoot : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | alias | Common-Table-Expression (WITH) subquery alias |
| IQueryDescription<TRoot> | sub | Common-Table-Expression (WITH) initial subquery description |
| Expression<Func<IQueryWithAdapter<TRoot>, IQueryWithFlag>>[] | attributes | Common-Table-Expression (WITH) attributes |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Type Parameters
| Name | Description |
|---|---|
| TRoot | Common-Table-Expression (WITH) initial subquery mapped type |
XmlSource(String, String, String, Expression<Func<IInnerFilterAdapter, IFilterDescription>>[])
Dynamic query XML data source mapping
Declaration
IQueryStructure XmlSource(string name, string alias, string xmlRoot, params Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | XML data variable name |
| String | alias | XML data source alias |
| String | xmlRoot | XML data root XPath expression |
| Expression<Func<IInnerFilterAdapter, IFilterDescription>>[] | filters | Filters and links applied to XML data source |
Returns
| Type | Description |
|---|---|
| IQueryStructure | Query structure |
Remarks
XML data passed to query as variable with name equals name of XML data source
Variable value must to be a String