Show / Hide Table of Contents

Class QueryExectionExtensions

Inheritance
object
QueryExectionExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public static class QueryExectionExtensions

Methods

ExecuteNonQuery(SqlCommand)

Declaration
public static int ExecuteNonQuery(this SqlCommand command)
Parameters
Type Name Description
SqlCommand command
Returns
Type Description
int

ExecuteNonQueryAsync(SqlCommand, CancellationToken)

Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<int> ExecuteNonQueryAsync(this SqlCommand command, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SqlCommand command
CancellationToken cancellationToken
Returns
Type Description
Task<int>

ExecuteReader(SqlCommand, bool)

Execute a SELECT statement against the database and return the results as an IAsyncEnumerable, suitable for linq expressions and iteration. But please DON'T use the anti-pattern 'fetch everything then post-filter using Linq'; put all the restrictions you can into the select before Fetch'ing the results.

Declaration
public static IEnumerable<ISoDataRecord> ExecuteReader(this SqlCommand command, bool ignoreSentry = false)
Parameters
Type Name Description
SqlCommand command

An SqlCommand that is a select

bool ignoreSentry
Returns
Type Description
IEnumerable<ISoDataRecord>

Enumerable result, which contains FieldInfo-based Get methods for all common data types

ExecuteReaderAsync(SqlCommand, bool, CancellationToken)

Execute a SELECT statement against the database and return the results as an IAsyncEnumerable, suitable for linq expressions and iteration. But please DON'T use the anti-pattern 'fetch everything then post-filter using Linq'; put all the restrictions you can into the select before Fetch'ing the results.

Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static IAsyncEnumerable<ISoDataRecord> ExecuteReaderAsync(this SqlCommand command, bool ignoreSentry = false, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SqlCommand command

An SqlCommand that is a select

bool ignoreSentry
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerable<ISoDataRecord>

Enumerable result, which contains FieldInfo-based Get methods for all common data types

ExecuteScalarAsync<T>(SqlCommand, bool, CancellationToken)

Declaration
public static Task<T> ExecuteScalarAsync<T>(this SqlCommand command, bool ignoreSentry, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SqlCommand command
bool ignoreSentry
CancellationToken cancellationToken
Returns
Type Description
Task<T>
Type Parameters
Name Description
T

ExecuteScalarAsync<T>(SqlCommand, CancellationToken)

Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<T> ExecuteScalarAsync<T>(this SqlCommand command, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SqlCommand command
CancellationToken cancellationToken
Returns
Type Description
Task<T>
Type Parameters
Name Description
T

ExecuteScalar<T>(SqlCommand)

Declaration
public static T ExecuteScalar<T>(this SqlCommand command)
Parameters
Type Name Description
SqlCommand command
Returns
Type Description
T
Type Parameters
Name Description
T

GetFieldPropertyRead(QueryExecutionHelper, FieldInfo)

Declaration
public static FieldProperty GetFieldPropertyRead(this QueryExecutionHelper qeh, FieldInfo field)
Parameters
Type Name Description
QueryExecutionHelper qeh
FieldInfo field
Returns
Type Description
FieldProperty
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top