Skip to main content

OrmLiteReadExpressionsApiAsync

Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public static class OrmLiteReadExpressionsApiAsync : object

Methods

SelectAsync<T>(IDbConnection, Expression<Func<T, Boolean>>, CancellationToken)

Returns results from using a LINQ Expression. E.g: <p>db.Select<Person>(x => x.Age > 40)</p>

View Source
Declaration
public static Task<List<T>> SelectAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Boolean>>predicate
CancellationTokentoken
Type Parameters
  • T

SelectAsync<T>(IDbConnection, SqlExpression<T>, CancellationToken)

Returns results from using an SqlExpression lambda. E.g: <p>db.Select(db.From<Person>().Where(x => x.Age > 40))</p>

View Source
Declaration
public static Task<List<T>> SelectAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T

SelectAsync<Into, From>(IDbConnection, SqlExpression<From>, CancellationToken)

Project results from a number of joined tables into a different model

View Source
Declaration
public static Task<List<Into>> SelectAsync<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, CancellationToken token = null)
Returns

Task<List<<Into>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • Into
  • From

SelectAsync<T>(IDbConnection, ISqlExpression, CancellationToken)

Returns results from using an SqlExpression lambda. E.g: <p>db.SelectAsync(db.From<Person>().Where(x => x.Age > 40))</p>

View Source
Declaration
public static Task<List<T>> SelectAsync<T>(this IDbConnection dbConn, ISqlExpression expression, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.ISqlExpressionexpression
CancellationTokentoken
Type Parameters
  • T

SelectMultiAsync<T, T2>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2>>> SelectMultiAsync<T, T2>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2

SelectMultiAsync<T, T2, T3>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3>>> SelectMultiAsync<T, T2, T3>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3

SelectMultiAsync<T, T2, T3, T4>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4>>> SelectMultiAsync<T, T2, T3, T4>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4

SelectMultiAsync<T, T2, T3, T4, T5>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5>>> SelectMultiAsync<T, T2, T3, T4, T5>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5

SelectMultiAsync<T, T2, T3, T4, T5, T6>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6>>> SelectMultiAsync<T, T2, T3, T4, T5, T6>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6

SelectMultiAsync<T, T2, T3, T4, T5, T6, T7>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6, T7>>> SelectMultiAsync<T, T2, T3, T4, T5, T6, T7>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>,<T7>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7

SelectMultiAsync<T, T2, T3, T4, T5, T6, T7, T8>(IDbConnection, SqlExpression<T>, CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6, T7, T8>>> SelectMultiAsync<T, T2, T3, T4, T5, T6, T7, T8>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>,<T7>,<T8>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • T8

SelectMultiAsync<T, T2>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2>>> SelectMultiAsync<T, T2>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2

SelectMultiAsync<T, T2, T3>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3>>> SelectMultiAsync<T, T2, T3>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3

SelectMultiAsync<T, T2, T3, T4>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4>>> SelectMultiAsync<T, T2, T3, T4>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4

SelectMultiAsync<T, T2, T3, T4, T5>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5>>> SelectMultiAsync<T, T2, T3, T4, T5>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5

SelectMultiAsync<T, T2, T3, T4, T5, T6>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6>>> SelectMultiAsync<T, T2, T3, T4, T5, T6>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6

SelectMultiAsync<T, T2, T3, T4, T5, T6, T7>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6, T7>>> SelectMultiAsync<T, T2, T3, T4, T5, T6, T7>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>,<T7>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7

SelectMultiAsync<T, T2, T3, T4, T5, T6, T7, T8>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

View Source
Declaration
public static Task<List<Tuple<T, T2, T3, T4, T5, T6, T7, T8>>> SelectMultiAsync<T, T2, T3, T4, T5, T6, T7, T8>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects, CancellationToken token = null)
Returns

Task<List<Tuple<<T>,<T2>,<T3>,<T4>,<T5>,<T6>,<T7>,<T8>>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]tableSelects
CancellationTokentoken
Type Parameters
  • T
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • T8

SingleAsync<T>(IDbConnection, Expression<Func<T, Boolean>>, CancellationToken)

Returns a single result from using a LINQ Expression. E.g: <p>db.Single<Person>(x => x.Age == 42)</p>

View Source
Declaration
public static Task<T> SingleAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Boolean>>predicate
CancellationTokentoken
Type Parameters
  • T

SingleAsync<T>(IDbConnection, SqlExpression<T>, CancellationToken)

Returns results from using an SqlExpression lambda. E.g: <p>db.SingleAsync<Person>(x => x.Age > 40)</p>

View Source
Declaration
public static Task<T> SingleAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T

SingleAsync<T>(IDbConnection, ISqlExpression, CancellationToken)

Returns results from using an SqlExpression lambda. E.g: <p>db.SingleAsync(db.From<Person>().Where(x => x.Age > 40))</p>

View Source
Declaration
public static Task<T> SingleAsync<T>(this IDbConnection dbConn, ISqlExpression expression, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.ISqlExpressionexpression
CancellationTokentoken
Type Parameters
  • T

ScalarAsync<T, TKey>(IDbConnection, Expression<Func<T, Object>>, CancellationToken)

Returns a scalar result from using an SqlExpression lambda. E.g: <p>db.Scalar<Person, int>(x => Sql.Max(x.Age))</p>

View Source
Declaration
public static Task<TKey> ScalarAsync<T, TKey>(this IDbConnection dbConn, Expression<Func<T, object>> field, CancellationToken token = null)
Returns

Task<<TKey>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
CancellationTokentoken
Type Parameters
  • T
  • TKey

ScalarAsync<T, TKey>(IDbConnection, Expression<Func<T, Object>>, Expression<Func<T, Boolean>>, CancellationToken)

Returns a scalar result from using an SqlExpression lambda. E.g: <p>db.Scalar<Person, int>(x => Sql.Max(x.Age), , x => x.Age < 50)</p>

View Source
Declaration
public static Task<TKey> ScalarAsync<T, TKey>(this IDbConnection dbConn, Expression<Func<T, object>> field, Expression<Func<T, bool>> predicate, CancellationToken token = null)
Returns

Task<<TKey>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Object>>field
Expression<Func<<T>,System.Boolean>>predicate
CancellationTokentoken
Type Parameters
  • T
  • TKey

CountAsync<T>(IDbConnection, Expression<Func<T, Boolean>>, CancellationToken)

Returns the count of rows that match the LINQ expression, E.g: <p>db.Count<Person>(x => x.Age < 50)</p>

View Source
Declaration
public static Task<long> CountAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> expression, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Boolean>>expression
CancellationTokentoken
Type Parameters
  • T

CountAsync<T>(IDbConnection, SqlExpression<T>, CancellationToken)

Returns the count of rows that match the supplied SqlExpression, E.g: <p>db.Count(db.From<Person>().Where(x => x.Age < 50))</p>

View Source
Declaration
public static Task<long> CountAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T

CountAsync<T>(IDbConnection, CancellationToken)

View Source
Declaration
public static Task<long> CountAsync<T>(this IDbConnection dbConn, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
IDbConnectiondbConn
CancellationTokentoken
Type Parameters
  • T

RowCountAsync<T>(IDbConnection, SqlExpression<T>, CancellationToken)

Return the number of rows returned by the supplied expression

View Source
Declaration
public static Task<long> RowCountAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
CancellationTokentoken
Type Parameters
  • T

RowCountAsync(IDbConnection, String, Object, CancellationToken)

Return the number of rows returned by the supplied sql

View Source
Declaration
public static Task<long> RowCountAsync(this IDbConnection dbConn, string sql, object anonType = null, CancellationToken token = null)
Returns

Task<System.Int64>

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql
System.ObjectanonType
CancellationTokentoken

LoadSelectAsync<T>(IDbConnection, Expression<Func<T, Boolean>>, String[], CancellationToken)

Returns results with references from using a LINQ Expression. E.g: <p>db.LoadSelectAsync<Person>(x => x.Age > 40)</p>

View Source
Declaration
public static Task<List<T>> LoadSelectAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, string[] include = null, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Boolean>>predicate
System.String[]include
CancellationTokentoken
Type Parameters
  • T

LoadSelectAsync<T>(IDbConnection, Expression<Func<T, Boolean>>, Expression<Func<T, Object>>)

Returns results with references from using a LINQ Expression. E.g: <p>db.LoadSelectAsync<Person>(x => x.Age > 40, include: x => new { x.PrimaryAddress })</p>

View Source
Declaration
public static Task<List<T>> LoadSelectAsync<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, Expression<Func<T, object>> include)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,System.Boolean>>predicate
Expression<Func<<T>,System.Object>>include
Type Parameters
  • T

LoadSelectAsync<T>(IDbConnection, SqlExpression<T>, String[], CancellationToken)

Returns results with references from using an SqlExpression lambda. E.g: <p>db.LoadSelectAsync(db.From<Person>().Where(x => x.Age > 40))</p>

View Source
Declaration
public static Task<List<T>> LoadSelectAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, string[] include = null, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]include
CancellationTokentoken
Type Parameters
  • T

LoadSelectAsync<T>(IDbConnection, SqlExpression<T>, IEnumerable<String>, CancellationToken)

Returns results with references from using an SqlExpression lambda. E.g: <p>db.LoadSelectAsync(db.From<Person>().Where(x => x.Age > 40), include:q.OnlyFields)</p>

View Source
Declaration
public static Task<List<T>> LoadSelectAsync<T>(this IDbConnection dbConn, SqlExpression<T> expression, IEnumerable<string> include, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
IEnumerable<System.String>include
CancellationTokentoken
Type Parameters
  • T

LoadSelectAsync<Into, From>(IDbConnection, SqlExpression<From>, String[], CancellationToken)

Project results with references from a number of joined tables into a different model

View Source
Declaration
public static Task<List<Into>> LoadSelectAsync<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, string[] include = null, CancellationToken token = null)
Returns

Task<List<<Into>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
System.String[]include
CancellationTokentoken
Type Parameters
  • Into
  • From

LoadSelectAsync<Into, From>(IDbConnection, SqlExpression<From>, IEnumerable<String>, CancellationToken)

Project results with references from a number of joined tables into a different model

View Source
Declaration
public static Task<List<Into>> LoadSelectAsync<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, IEnumerable<string> include, CancellationToken token = null)
Returns

Task<List<<Into>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
IEnumerable<System.String>include
CancellationTokentoken
Type Parameters
  • Into
  • From

LoadSelectAsync<Into, From>(IDbConnection, SqlExpression<From>, Expression<Func<Into, Object>>)

Project results with references from a number of joined tables into a different model

View Source
Declaration
public static Task<List<Into>> LoadSelectAsync<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, Expression<Func<Into, object>> include)
Returns

Task<List<<Into>>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.SqlExpression<T>expression
Expression<Func<<Into>,System.Object>>include
Type Parameters
  • Into
  • From

GetSchemaTableAsync(IDbConnection, String, CancellationToken)

Return ADO.NET reader.GetSchemaTable() in a DataTable

View Source
Declaration
public static Task<DataTable> GetSchemaTableAsync(this IDbConnection dbConn, string sql, CancellationToken token = null)
Returns

Task<DataTable>

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql
CancellationTokentoken

GetTableColumnsAsync<T>(IDbConnection, CancellationToken)

Get Table Column Schemas for specified table

View Source
Declaration
public static Task<ColumnSchema[]> GetTableColumnsAsync<T>(this IDbConnection dbConn, CancellationToken token = null)
Returns

Task<ServiceStack.OrmLite.ColumnSchema[]>

Parameters
TypeName
IDbConnectiondbConn
CancellationTokentoken
Type Parameters
  • T

GetTableColumnsAsync(IDbConnection, Type, CancellationToken)

Get Table Column Schemas for specified table

View Source
Declaration
public static Task<ColumnSchema[]> GetTableColumnsAsync(this IDbConnection dbConn, Type type, CancellationToken token = null)
Returns

Task<ServiceStack.OrmLite.ColumnSchema[]>

Parameters
TypeName
IDbConnectiondbConn
Typetype
CancellationTokentoken

GetTableColumnsAsync(IDbConnection, String, CancellationToken)

Get Table Column Schemas for result-set return from specified sql

View Source
Declaration
public static Task<ColumnSchema[]> GetTableColumnsAsync(this IDbConnection dbConn, string sql, CancellationToken token = null)
Returns

Task<ServiceStack.OrmLite.ColumnSchema[]>

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql
CancellationTokentoken

EnableForeignKeysCheckAsync(IDbConnection, CancellationToken)

View Source
Declaration
public static Task EnableForeignKeysCheckAsync(this IDbConnection dbConn, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbConnectiondbConn
CancellationTokentoken

DisableForeignKeysCheckAsync(IDbConnection, CancellationToken)

View Source
Declaration
public static Task DisableForeignKeysCheckAsync(this IDbConnection dbConn, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbConnectiondbConn
CancellationTokentoken