Show / Hide Table of Contents

Class Query<TResultType>

Provides the means to execute query objects.

Inheritance
System.Object
Query<TResultType>
Implements
IQuery<TResultType>
IDisposable
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 Source

Query(IDatabaseConnector)

Initializes a new instance of the Query<TResultType> class.

Declaration
public Query(IDatabaseConnector connector)
Parameters
Type Name Description
IDatabaseConnector connector

The database connector.

| Improve this Doc View Source

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 Source

Connector

Gets the database connector.

Declaration
protected IDatabaseConnector Connector { get; }
Property Value
Type Description
IDatabaseConnector
| Improve this Doc View Source

Descriptor

Gets the table type descriptor.

Declaration
protected ITableTypeDescriptor Descriptor { get; }
Property Value
Type Description
ITableTypeDescriptor
| Improve this Doc View Source

Mapper

Gets or sets the database reader mapper.

Declaration
protected IDatabaseReaderMapper<TResultType> Mapper { get; set; }
Property Value
Type Description
IDatabaseReaderMapper<TResultType>
| Improve this Doc View Source

SelectCommandBuilder

Gets the select command builder.

Declaration
protected ISelectCommandBuilder SelectCommandBuilder { get; }
Property Value
Type Description
ISelectCommandBuilder

Methods

| Improve this Doc View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

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 .

| Improve this Doc View Source

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 .

Implements

IQuery<TResultType>
IDisposable

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)

See Also

IQuery<TResultType>
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.