SqlSet<TResult> Class

Represents an immutable, connected SQL query that maps to TResult objects. This class cannot be instantiated, to get an instance use one of the Database.From<TResult>(String) or Database.FromQuery<TResult>(SqlBuilder) overloads.

Inheritance Hierarchy

System.Object
  DbExtensions.SqlSet
    DbExtensions.SqlSet<TResult>
      DbExtensions.SqlTable<TEntity>

Namespace: DbExtensions
Assembly: DbExtensions.dll

Syntax

public class SqlSet<TResult> : SqlSet

Type Parameters

TResult

The type of objects to map the results to.

The SqlSet<TResult> type exposes the following members.

Properties

Name Description
Database The Database this set is connected to.
(Inherited from SqlSet)
ResultType The type of objects this set returns. This property can be null.
(Inherited from SqlSet)

Methods

Name Description
All(OperatorStringHandler) Determines whether all elements of the set satisfy a condition.
(Inherited from SqlSet)
All(String) Determines whether all elements of the set satisfy a condition.
(Inherited from SqlSet)
AllAsync(OperatorStringHandler, CancellationToken) Determines whether all elements of the set satisfy a condition.
(Inherited from SqlSet)
AllAsync(String, CancellationToken) Determines whether all elements of the set satisfy a condition.
(Inherited from SqlSet)
Any() Determines whether the set contains any elements.
(Inherited from SqlSet)
Any(OperatorStringHandler) Determines whether any element of the set satisfies a condition.
(Inherited from SqlSet)
Any(String) Determines whether any element of the set satisfies a condition.
(Inherited from SqlSet)
AnyAsync(CancellationToken) Determines whether the set contains any elements.
(Inherited from SqlSet)
AnyAsync(OperatorStringHandler, CancellationToken) Determines whether any element of the set satisfies a condition.
(Inherited from SqlSet)
AnyAsync(String, CancellationToken) Determines whether any element of the set satisfies a condition.
(Inherited from SqlSet)
AsAsyncEnumerable Gets all TResult objects in the set. The query is deferred-executed.
AsEnumerable Gets all TResult objects in the set. The query is deferred-executed.
Cast(Type) Casts the elements of the set to the specified type.
(Inherited from SqlSet)
Cast<TResult>() Casts the elements of the set to the specified type.
(Inherited from SqlSet)
Contains(Object) Checks the existance of the entity, using the primary key value.
(Inherited from SqlSet)
Contains(TResult) Checks the existance of the entity, using the primary key value.
ContainsAsync(Object, CancellationToken) Checks the existance of the entity, using the primary key value.
(Inherited from SqlSet)
ContainsAsync(TResult, CancellationToken) Checks the existance of the entity, using the primary key value.
ContainsKey Checks the existance of an entity whose primary matches the id parameter.
(Inherited from SqlSet)
ContainsKeyAsync Checks the existance of an entity whose primary matches the id parameter.
(Inherited from SqlSet)
Count() Returns the number of elements in the set.
(Inherited from SqlSet)
Count(OperatorStringHandler) Returns a number that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
Count(String) Returns a number that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
CountAsync(CancellationToken) Returns the number of elements in the set.
(Inherited from SqlSet)
CountAsync(OperatorStringHandler, CancellationToken) Returns a number that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
CountAsync(String, CancellationToken) Returns a number that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
Find Gets the entity whose primary key matches the id parameter.
FindAsync Gets the entity whose primary key matches the id parameter.
First() Returns the first element of the set.
First(OperatorStringHandler) Returns the first element in the set that satisfies a specified condition.
First(String) Returns the first element in the set that satisfies a specified condition.
FirstAsync(CancellationToken) Returns the first element of the set.
FirstAsync(OperatorStringHandler, CancellationToken) Returns the first element in the set that satisfies a specified condition.
FirstAsync(String, CancellationToken) Returns the first element in the set that satisfies a specified condition.
FirstOrDefault() Returns the first element of the set, or a default value if the set contains no elements.
FirstOrDefault(OperatorStringHandler) Returns the first element of the set that satisfies a condition or a default value if no such element is found.
FirstOrDefault(String) Returns the first element of the set that satisfies a condition or a default value if no such element is found.
FirstOrDefaultAsync(CancellationToken) Returns the first element of the set, or a default value if the set contains no elements.
FirstOrDefaultAsync(OperatorStringHandler, CancellationToken) Returns the first element of the set that satisfies a condition or a default value if no such element is found.
FirstOrDefaultAsync(String, CancellationToken) Returns the first element of the set that satisfies a condition or a default value if no such element is found.
GetAsyncEnumerator Returns an async enumerator that iterates through the set.
GetDefiningQuery Returns the SQL query that is the source of data for the set.
(Inherited from SqlSet)
GetEnumerator Returns an enumerator that iterates through the set.
Include(String) Specifies the related objects to include in the query results.
Include(Func<TResult, Object>, String) Specifies the related objects to include in the query results.
IncludeMany(String, Func<SqlSet, SqlSet>) Specifies which collections to include in the query results.
IncludeMany<TElement>(Func<TResult, ICollection<TElement», Func<SqlSet<TElement>, SqlSet<TElement», String) Specifies which collections to include in the query results.
LongCount() Returns an Int64 that represents the total number of elements in the set.
(Inherited from SqlSet)
LongCount(OperatorStringHandler) Returns an Int64 that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
LongCount(String) Returns an Int64 that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
LongCountAsync(CancellationToken) Returns an Int64 that represents the total number of elements in the set.
(Inherited from SqlSet)
LongCountAsync(OperatorStringHandler, CancellationToken) Returns an Int64 that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
LongCountAsync(String, CancellationToken) Returns an Int64 that represents how many elements in the set satisfy a condition.
(Inherited from SqlSet)
OrderBy(OperatorStringHandler) Sorts the elements of the set according to the columnList.
OrderBy(String) Sorts the elements of the set according to the columnList.
Select(OperatorStringHandler, Type) Projects each element of the set into a new form.
(Inherited from SqlSet)
Select(String, Type) Projects each element of the set into a new form.
(Inherited from SqlSet)
Select<TResult>(OperatorStringHandler) Projects each element of the set into a new form.
(Inherited from SqlSet)
Select<TResult>(String) Projects each element of the set into a new form.
(Inherited from SqlSet)
Select<TResult>(OperatorStringHandler, Func<DbDataReader, TResult>) Projects each element of the set into a new form.
(Inherited from SqlSet)
Select<TResult>(String, Func<DbDataReader, TResult>) Projects each element of the set into a new form.
(Inherited from SqlSet)
Single() The single element of the set.
Single(OperatorStringHandler) Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
Single(String) Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
SingleAsync(CancellationToken) The single element of the set.
SingleAsync(OperatorStringHandler, CancellationToken) Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
SingleAsync(String, CancellationToken) Returns the only element of the set that satisfies a specified condition, and throws an exception if more than one such element exists.
SingleOrDefault() Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
SingleOrDefault(OperatorStringHandler) Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
SingleOrDefault(String) Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
SingleOrDefaultAsync(CancellationToken) Returns the only element of the set, or a default value if the set is empty; this method throws an exception if there is more than one element in the set.
SingleOrDefaultAsync(OperatorStringHandler, CancellationToken) Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
SingleOrDefaultAsync(String, CancellationToken) Returns the only element of the set that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.
Skip Bypasses a specified number of elements in the set and then returns the remaining elements.
Take Returns a specified number of contiguous elements from the start of the set.
ToArray Creates an array from the set.
ToArrayAsync Creates an array from the set.
ToList Creates a List<TResult> from the set.
ToListAsync Creates a List<TResult> from the set.
ToString Returns the SQL query of the set.
(Inherited from SqlSet)
Where(OperatorStringHandler) Filters the set based on a predicate.
Where(String) Filters the set based on a predicate.

Remarks

For information on how to use SqlSet see SqlSet Tutorial.

See Also

Reference

DbExtensions Namespace

© Max Toro Q.