Table of Contents

Struct DbQueryCall

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

Represents a DbQuery bound to a source with some values added. A readonly struct: each AddParam returns a new one and leaves this one unchanged, so a call can be kept and branched.

public readonly struct DbQueryCall : IExecuteReaderAsync, IExecuteReader, IEquatable<DbQueryCall>
Implements
Inherited Members
Extension Methods

Remarks

A call that is kept and added to twice does not interfere with itself: the second addition works on a copy. A value that is an object, and the object of AddParams, is read when the query runs.

Map it with Map<T>(), then run a terminal. Nothing touches the database before that.

Properties

Source

The connection, transaction, pool or factory the query is bound to.

Methods

AddParam(string, string?)

Adds an input parameter with a string value.

AddParam<T>(string, T)

Adds an input parameter named as you write it.

AddParam<T>(T, string?)

Adds an input parameter named for the argument: AddParam(authorId) adds authorId, AddParam(filter.AuthorId) adds AuthorId.

AddParams<T>(T)

Adds the public properties and fields of values as parameters, each under its own name.

AsDictionaryRows()

Reads each row without a model, as a DictionaryRow.

AsObjectArrays()

Reads each row without a model, as an array of its values.

Equals(DbQueryCall)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Indicates whether this instance and a specified object are equal.

GetHashCode()

Returns the hash code for this instance.

Map<T>()

Maps each row to a T by column name (a single value such as int is read from the first column), and returns the mapped query.

Map<T>(RowMap<T>?)

Maps each row to a T with a map the caller declared, and returns the mapped query.

Map<T>(Func<IDataRecord, T>)

Maps each row with a selector, and returns the mapped query.

Operators

operator ==(DbQueryCall, DbQueryCall)

Determines whether two calls are the same definition on the same source with the same values added.

operator !=(DbQueryCall, DbQueryCall)

Determines whether two calls differ.