Skip to main content

OrmLiteReadExpressionsApi

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

Methods

Exec<T>(IDbConnection, Func<IDbCommand, T>)

View Source
Declaration
public static T Exec<T>(this IDbConnection dbConn, Func<IDbCommand, T> filter)
Returns

<T>

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,<T>>filter
Type Parameters
  • T

Exec(IDbConnection, Action<IDbCommand>)

View Source
Declaration
public static void Exec(this IDbConnection dbConn, Action<IDbCommand> filter)
Parameters
TypeName
IDbConnectiondbConn
Action<IDbCommand>filter

Exec<T>(IDbConnection, Func<IDbCommand, Task<T>>)

View Source
Declaration
public static Task<T> Exec<T>(this IDbConnection dbConn, Func<IDbCommand, Task<T>> filter)
Returns

Task<<T>>

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,Task<<T>>>filter
Type Parameters
  • T

Exec(IDbConnection, Func<IDbCommand, Task>)

View Source
Declaration
public static Task Exec(this IDbConnection dbConn, Func<IDbCommand, Task> filter)
Returns

Task

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,Task>filter

ExecLazy<T>(IDbConnection, Func<IDbCommand, IEnumerable<T>>)

View Source
Declaration
public static IEnumerable<T> ExecLazy<T>(this IDbConnection dbConn, Func<IDbCommand, IEnumerable<T>> filter)
Returns

IEnumerable<<T>>

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,IEnumerable<<T>>>filter
Type Parameters
  • T

Exec(IDbConnection, Func<IDbCommand, IDbCommand>)

View Source
Declaration
public static IDbCommand Exec(this IDbConnection dbConn, Func<IDbCommand, IDbCommand> filter)
Returns

IDbCommand

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,IDbCommand>filter

Exec(IDbConnection, Func<IDbCommand, Task<IDbCommand>>)

View Source
Declaration
public static Task<IDbCommand> Exec(this IDbConnection dbConn, Func<IDbCommand, Task<IDbCommand>> filter)
Returns

Task<IDbCommand>

Parameters
TypeName
IDbConnectiondbConn
Func<IDbCommand,Task<IDbCommand>>filter

From<T>(IDbConnection)

Creates a new SqlExpression builder allowing typed LINQ-like queries. Alias for SqlExpression.

View Source
Declaration
public static SqlExpression<T> From<T>(this IDbConnection dbConn)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
Type Parameters
  • T

From<T>(IDbConnection, Action<SqlExpression<T>>)

View Source
Declaration
public static SqlExpression<T> From<T>(this IDbConnection dbConn, Action<SqlExpression<T>> options)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
Action<ServiceStack.OrmLite.SqlExpression<<T>>>options
Type Parameters
  • T

From<T, JoinWith>(IDbConnection, Expression<Func<T, JoinWith, Boolean>>)

View Source
Declaration
public static SqlExpression<T> From<T, JoinWith>(this IDbConnection dbConn, Expression<Func<T, JoinWith, bool>> joinExpr = null)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
Expression<Func<<T>,<JoinWith>,System.Boolean>>joinExpr
Type Parameters
  • T
  • JoinWith

From<T>(IDbConnection, String)

Creates a new SqlExpression builder for the specified type using a user-defined FROM sql expression.

View Source
Declaration
public static SqlExpression<T> From<T>(this IDbConnection dbConn, string fromExpression)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
System.StringfromExpression
Type Parameters
  • T

From<T>(IDbConnection, TableOptions)

View Source
Declaration
public static SqlExpression<T> From<T>(this IDbConnection dbConn, TableOptions tableOptions)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.TableOptionstableOptions
Type Parameters
  • T

TagWith<T>(SqlExpression<T>, String)

View Source
Declaration
public static SqlExpression<T> TagWith<T>(this SqlExpression<T> expression, string tag)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
ServiceStack.OrmLite.SqlExpression<T>expression
System.Stringtag
Type Parameters
  • T

TagWithCallSite<T>(SqlExpression<T>, String, Int32)

View Source
Declaration
public static SqlExpression<T> TagWithCallSite<T>(this SqlExpression<T> expression, string filePath = null, int lineNumber = 0)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
ServiceStack.OrmLite.SqlExpression<T>expression
System.StringfilePath
System.Int32lineNumber
Type Parameters
  • T

From<T>(IDbConnection, TableOptions, Action<SqlExpression<T>>)

View Source
Declaration
public static SqlExpression<T> From<T>(this IDbConnection dbConn, TableOptions tableOptions, Action<SqlExpression<T>> options)
Returns

ServiceStack.OrmLite.SqlExpression<T>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.TableOptionstableOptions
Action<ServiceStack.OrmLite.SqlExpression<<T>>>options
Type Parameters
  • T

JoinAlias(IDbConnection, String)

View Source
Declaration
public static JoinFormatDelegate JoinAlias(this IDbConnection db, string alias)
Returns

ServiceStack.OrmLite.JoinFormatDelegate

Parameters
TypeName
IDbConnectiondb
System.Stringalias

TableAlias(IDbConnection, String)

View Source
Declaration
public static TableOptions TableAlias(this IDbConnection db, string alias)
Returns

ServiceStack.OrmLite.TableOptions

Parameters
TypeName
IDbConnectiondb
System.Stringalias

GetTableName<T>(IDbConnection)

View Source
Declaration
public static string GetTableName<T>(this IDbConnection db)
Returns

System.String

Parameters
TypeName
IDbConnectiondb
Type Parameters
  • T

GetTableNames(IDbConnection)

View Source
Declaration
public static List<string> GetTableNames(this IDbConnection db)
Returns

List<System.String>

Parameters
TypeName
IDbConnectiondb

GetTableNames(IDbConnection, String)

View Source
Declaration
public static List<string> GetTableNames(this IDbConnection db, string schema)
Returns

List<System.String>

Parameters
TypeName
IDbConnectiondb
System.Stringschema

GetTableNamesAsync(IDbConnection)

View Source
Declaration
public static Task<List<string>> GetTableNamesAsync(this IDbConnection db)
Returns

Task<List<System.String>>

Parameters
TypeName
IDbConnectiondb

GetTableNamesAsync(IDbConnection, String)

View Source
Declaration
public static Task<List<string>> GetTableNamesAsync(this IDbConnection db, string schema)
Returns

Task<List<System.String>>

Parameters
TypeName
IDbConnectiondb
System.Stringschema

GetTableNamesWithRowCounts(IDbConnection, Boolean, String)

View Source
Declaration
public static List<KeyValuePair<string, long>> GetTableNamesWithRowCounts(this IDbConnection db, bool live = false, string schema = null)
Returns

List<KeyValuePair<System.String,System.Int64>>

Parameters
TypeName
IDbConnectiondb
System.Booleanlive
System.Stringschema

GetTableNamesWithRowCountsAsync(IDbConnection, Boolean, String)

View Source
Declaration
public static async Task<List<KeyValuePair<string, long>>> GetTableNamesWithRowCountsAsync(this IDbConnection db, bool live = false, string schema = null)
Returns

Task<List<KeyValuePair<System.String,System.Int64>>>

Parameters
TypeName
IDbConnectiondb
System.Booleanlive
System.Stringschema

GetQuotedTableName<T>(IDbConnection)

View Source
Declaration
public static string GetQuotedTableName<T>(this IDbConnection db)
Returns

System.String

Parameters
TypeName
IDbConnectiondb
Type Parameters
  • T

OpenTransaction(IDbConnection)

Open a Transaction in OrmLite

View Source
Declaration
public static IDbTransaction OpenTransaction(this IDbConnection dbConn)
Returns

IDbTransaction

Parameters
TypeName
IDbConnectiondbConn

OpenTransactionIfNotExists(IDbConnection)

Returns a new transaction if not yet exists, otherwise null

View Source
Declaration
public static IDbTransaction OpenTransactionIfNotExists(this IDbConnection dbConn)
Returns

IDbTransaction

Parameters
TypeName
IDbConnectiondbConn

OpenTransaction(IDbConnection, IsolationLevel)

Open a Transaction in OrmLite

View Source
Declaration
public static IDbTransaction OpenTransaction(this IDbConnection dbConn, IsolationLevel isolationLevel)
Returns

IDbTransaction

Parameters
TypeName
IDbConnectiondbConn
IsolationLevelisolationLevel

OpenTransactionIfNotExists(IDbConnection, IsolationLevel)

Returns a new transaction if not yet exists, otherwise null

View Source
Declaration
public static IDbTransaction OpenTransactionIfNotExists(this IDbConnection dbConn, IsolationLevel isolationLevel)
Returns

IDbTransaction

Parameters
TypeName
IDbConnectiondbConn
IsolationLevelisolationLevel

OpenCommand(IDbConnection)

Create a managed OrmLite IDbCommand

View Source
Declaration
public static IDbCommand OpenCommand(this IDbConnection dbConn)
Returns

IDbCommand

Parameters
TypeName
IDbConnectiondbConn

Select<T>(IDbConnection, Expression<Func<T, Boolean>>)

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

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

List<<T>>

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

Select<T>(IDbConnection, SqlExpression<T>)

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 List<T> Select<T>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

List<<T>>

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

Select<T>(IDbConnection, ISqlExpression, Object)

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 List<T> Select<T>(this IDbConnection dbConn, ISqlExpression expression, object anonType = null)
Returns

List<<T>>

Parameters
TypeName
IDbConnectiondbConn
ServiceStack.OrmLite.ISqlExpressionexpression
System.ObjectanonType
Type Parameters
  • T

SelectMulti<T, T2>(IDbConnection, SqlExpression<T>)

View Source
Declaration
public static List<Tuple<T, T2>> SelectMulti<T, T2>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

SelectMulti<T, T2, T3>(IDbConnection, SqlExpression<T>)

View Source
Declaration
public static List<Tuple<T, T2, T3>> SelectMulti<T, T2, T3>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

SelectMulti<T, T2, T3, T4>(IDbConnection, SqlExpression<T>)

View Source
Declaration
public static List<Tuple<T, T2, T3, T4>> SelectMulti<T, T2, T3, T4>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4, T5>> SelectMulti<T, T2, T3, T4, T5>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4, T5, T6>> SelectMulti<T, T2, T3, T4, T5, T6>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4, T5, T6, T7>> SelectMulti<T, T2, T3, T4, T5, T6, T7>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4, T5, T6, T7, T8>> SelectMulti<T, T2, T3, T4, T5, T6, T7, T8>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2>> SelectMulti<T, T2>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3>> SelectMulti<T, T2, T3>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4>> SelectMulti<T, T2, T3, T4>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects)
Returns

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

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

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

View Source
Declaration
public static List<Tuple<T, T2, T3, T4, T5>> SelectMulti<T, T2, T3, T4, T5>(this IDbConnection dbConn, SqlExpression<T> expression, string[] tableSelects)
Returns

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Single<T>(IDbConnection, Expression<Func<T, Boolean>>)

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 T Single<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate)
Returns

<T>

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

Single<T>(IDbConnection, SqlExpression<T>)

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

View Source
Declaration
public static T Single<T>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

<T>

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

Single<T>(IDbConnection, ISqlExpression)

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

View Source
Declaration
public static T Single<T>(this IDbConnection dbConn, ISqlExpression expression)
Returns

<T>

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

Scalar<T, TKey>(IDbConnection, Expression<Func<T, Object>>)

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 TKey Scalar<T, TKey>(this IDbConnection dbConn, Expression<Func<T, object>> field)
Returns

<TKey>

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

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

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 TKey Scalar<T, TKey>(this IDbConnection dbConn, Expression<Func<T, object>> field, Expression<Func<T, bool>> predicate)
Returns

<TKey>

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

Count<T>(IDbConnection, Expression<Func<T, Boolean>>)

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 long Count<T>(this IDbConnection dbConn, Expression<Func<T, bool>> expression)
Returns

System.Int64

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

Count<T>(IDbConnection, SqlExpression<T>)

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 long Count<T>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

System.Int64

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

Count<T>(IDbConnection)

View Source
Declaration
public static long Count<T>(this IDbConnection dbConn)
Returns

System.Int64

Parameters
TypeName
IDbConnectiondbConn
Type Parameters
  • T

RowCount<T>(IDbConnection, SqlExpression<T>)

Return the number of rows returned by the supplied expression

View Source
Declaration
public static long RowCount<T>(this IDbConnection dbConn, SqlExpression<T> expression)
Returns

System.Int64

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

RowCount(IDbConnection, String, Object)

Return the number of rows returned by the supplied sql

View Source
Declaration
public static long RowCount(this IDbConnection dbConn, string sql, object anonType = null)
Returns

System.Int64

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql
System.ObjectanonType

RowCount(IDbConnection, String, IEnumerable<IDbDataParameter>)

Return the number of rows returned by the supplied sql and db params

View Source
Declaration
public static long RowCount(this IDbConnection dbConn, string sql, IEnumerable<IDbDataParameter> sqlParams)
Returns

System.Int64

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql
IEnumerable<IDbDataParameter>sqlParams

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

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

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

List<<T>>

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

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

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

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

List<<T>>

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

LoadSelect<T>(IDbConnection, SqlExpression<T>, String[])

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

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

List<<T>>

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

LoadSelect<T>(IDbConnection, SqlExpression<T>, IEnumerable<String>)

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

View Source
Declaration
public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T> expression, IEnumerable<string> include)
Returns

List<<T>>

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

LoadSelect<T>(IDbConnection, SqlExpression<T>, Expression<Func<T, Object>>)

Returns results with references from using an SqlExpression lambda. E.g: <p>db.LoadSelect(db.From<Person>().Where(x => x.Age > 40), include: x => new { x.PrimaryAddress })</p>

View Source
Declaration
public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T> expression, Expression<Func<T, object>> include)
Returns

List<<T>>

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

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

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

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

List<<Into>>

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

LoadSelect<Into, From>(IDbConnection, SqlExpression<From>, IEnumerable<String>)

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

View Source
Declaration
public static List<Into> LoadSelect<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, IEnumerable<string> include)
Returns

List<<Into>>

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

LoadSelect<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 List<Into> LoadSelect<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, Expression<Func<Into, object>> include)
Returns

List<<Into>>

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

GetSchemaTable(IDbConnection, String)

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

View Source
Declaration
public static DataTable GetSchemaTable(this IDbConnection dbConn, string sql)
Returns

DataTable

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql

GetTableColumns<T>(IDbConnection)

Get Table Column Schemas for specified table

View Source
Declaration
public static ColumnSchema[] GetTableColumns<T>(this IDbConnection dbConn)
Returns

ServiceStack.OrmLite.ColumnSchema[]

Parameters
TypeName
IDbConnectiondbConn
Type Parameters
  • T

GetTableColumns(IDbConnection, Type)

Get Table Column Schemas for specified table

View Source
Declaration
public static ColumnSchema[] GetTableColumns(this IDbConnection dbConn, Type type)
Returns

ServiceStack.OrmLite.ColumnSchema[]

Parameters
TypeName
IDbConnectiondbConn
Typetype

GetTableColumns(IDbConnection, String)

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

View Source
Declaration
public static ColumnSchema[] GetTableColumns(this IDbConnection dbConn, string sql)
Returns

ServiceStack.OrmLite.ColumnSchema[]

Parameters
TypeName
IDbConnectiondbConn
System.Stringsql

EnableForeignKeysCheck(IDbConnection)

View Source
Declaration
public static void EnableForeignKeysCheck(this IDbConnection dbConn)
Parameters
TypeName
IDbConnectiondbConn

DisableForeignKeysCheck(IDbConnection)

View Source
Declaration
public static void DisableForeignKeysCheck(this IDbConnection dbConn)
Parameters
TypeName
IDbConnectiondbConn