Struct DbQueryUsing
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
Represents a DbQuery bound to where its connections come from.
public readonly struct DbQueryUsing : IExecuteReaderAsync, IExecuteReader, IEquatable<DbQueryUsing>
- Implements
- Inherited Members
- Extension Methods
Remarks
Add the values with AddParam or AddParams and then
Map<T>(); or call Map<T>() for a query that takes
no values.
It is a reader the same way a command is, so the Map
extensions on IExecuteReader apply to it.
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)addsauthorId,AddParam(filter.AuthorId)addsAuthorId.
- AddParams<T>(T)
Adds the public properties and fields of
valuesas 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(DbQueryUsing)
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
Tby 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
Twith 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 ==(DbQueryUsing, DbQueryUsing)
Determines whether two bound queries are the same definition on the same source.
- operator !=(DbQueryUsing, DbQueryUsing)
Determines whether two bound queries differ.