Class Query<TResultType>
Provides the means to execute query objects.
Inheritance
Namespace: Paradigm.ORM.Data.Querying
Assembly: Paradigm.ORM.Data.dll
Syntax
public class Query<TResultType> : object, IQuery<TResultType>, IDisposable where TResultType : class
Type Parameters
Name | Description |
---|---|
TResultType | The type containing or referencing the mapping information, that will be returned after executing the query. |
Remarks
A query object encapsulates all the steps in a data reader operation. Basically contains a table type descriptor, a select command and a database reader mapper. The basic idea behind a query is to facilitate the creation of queries, and the ability to reuse them if neccessary.
Constructors
| Improve this Doc View SourceQuery(IDatabaseConnector)
Initializes a new instance of the Query<TResultType> class.
Declaration
public Query(IDatabaseConnector connector)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
Query(IDatabaseConnector, ITableTypeDescriptor)
Initializes a new instance of the Query<TResultType> class.
Declaration
public Query(IDatabaseConnector connector, ITableTypeDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
IDatabaseConnector | connector | The database connector. |
ITableTypeDescriptor | descriptor | The table type descriptor. |
Properties
| Improve this Doc View SourceConnector
Gets the database connector.
Declaration
protected IDatabaseConnector Connector { get; }
Property Value
Type | Description |
---|---|
IDatabaseConnector |
Descriptor
Gets the table type descriptor.
Declaration
protected ITableTypeDescriptor Descriptor { get; }
Property Value
Type | Description |
---|---|
ITableTypeDescriptor |
Mapper
Gets or sets the database reader mapper.
Declaration
protected IDatabaseReaderMapper<TResultType> Mapper { get; set; }
Property Value
Type | Description |
---|---|
IDatabaseReaderMapper<TResultType> |
SelectCommandBuilder
Gets the select command builder.
Declaration
protected ISelectCommandBuilder SelectCommandBuilder { get; }
Property Value
Type | Description |
---|---|
ISelectCommandBuilder |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Execute(String, Object[])
Executes the specified query and returns a list of
Declaration
public List<TResultType> Execute(string whereClause = null, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
List<TResultType> | A list of |
ExecuteAsync(String, Object[])
Executes the specified query and returns a list of
Declaration
public Task<List<TResultType>> ExecuteAsync(string whereClause = null, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | whereClause | A where filter clause. Do not add the "WHERE" keyword to it. If you need to pass parameters, pass using @1, @2, @3. |
System.Object[] | parameters | A list of parameter values. |
Returns
Type | Description |
---|---|
Task<List<TResultType>> | A list of |