Class Database
Inheritance
System.Object
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public class Database : IDisposable
Constructors
Database(IDbConnection)
Declaration
public Database(IDbConnection connection)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
Database(String)
Declaration
public Database(string connectionStringName)
Parameters
Type |
Name |
Description |
System.String |
connectionStringName |
|
Database(String, DbProviderFactory)
Declaration
public Database(string connectionString, DbProviderFactory provider)
Parameters
Type |
Name |
Description |
System.String |
connectionString |
|
System.Data.Common.DbProviderFactory |
provider |
|
Database(String, String)
Declaration
public Database(string connectionString, string providerName)
Parameters
Type |
Name |
Description |
System.String |
connectionString |
|
System.String |
providerName |
|
Properties
CommandTimeout
Declaration
public int CommandTimeout { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Connection
Declaration
public IDbConnection Connection { get; }
Property Value
Type |
Description |
System.Data.IDbConnection |
|
CurrentTransactionIsolationLevel
Declaration
public IsolationLevel CurrentTransactionIsolationLevel { get; }
Property Value
Type |
Description |
System.Data.IsolationLevel |
|
DatabaseType
Declaration
public Database.DBType DatabaseType { get; }
Property Value
EnableAutoSelect
Declaration
public bool EnableAutoSelect { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
EnableNamedParams
Declaration
public bool EnableNamedParams { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ForceDateTimesToUtc
Declaration
public bool ForceDateTimesToUtc { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
KeepConnectionAlive
Declaration
public bool KeepConnectionAlive { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
LastArgs
Declaration
public object[] LastArgs { get; }
Property Value
Type |
Description |
System.Object[] |
|
LastCommand
Declaration
public string LastCommand { get; }
Property Value
Type |
Description |
System.String |
|
LastSQL
Declaration
public string LastSQL { get; }
Property Value
Type |
Description |
System.String |
|
Mapper
Declaration
public static IMapper Mapper { get; set; }
Property Value
OneTimeCommandTimeout
Declaration
public int OneTimeCommandTimeout { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
AbortTransaction()
Declaration
public void AbortTransaction()
BeginTransaction()
Declaration
public void BeginTransaction()
BeginTransaction(IsolationLevel)
Declaration
public void BeginTransaction(IsolationLevel isolationLevel)
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
|
BuildPageQueries<T>(Int64, Int64, String, ref Object[], out String, out String)
Declaration
public void BuildPageQueries<T>(long skip, long take, string sql, ref object[] args, out string sqlCount, out string sqlPage)
Parameters
Type |
Name |
Description |
System.Int64 |
skip |
|
System.Int64 |
take |
|
System.String |
sql |
|
System.Object[] |
args |
|
System.String |
sqlCount |
|
System.String |
sqlPage |
|
Type Parameters
CloseSharedConnection()
Declaration
public void CloseSharedConnection()
CompleteTransaction()
Declaration
public void CompleteTransaction()
CreateCommand(IDbConnection, String, Object[])
Declaration
public IDbCommand CreateCommand(IDbConnection connection, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Data.IDbCommand |
|
Delete(Object)
Declaration
public int Delete(object poco)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
Returns
Type |
Description |
System.Int32 |
|
Delete(String, String, Object)
Declaration
public int Delete(string tableName, string primaryKeyName, object poco)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
Returns
Type |
Description |
System.Int32 |
|
Delete(String, String, Object, Object)
Declaration
public int Delete(string tableName, string primaryKeyName, object poco, object primaryKeyValue)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
System.Object |
primaryKeyValue |
|
Returns
Type |
Description |
System.Int32 |
|
Delete<T>(Object)
Declaration
public int Delete<T>(object pocoOrPrimaryKey)
Parameters
Type |
Name |
Description |
System.Object |
pocoOrPrimaryKey |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
Delete<T>(String, Object[])
Declaration
public int Delete<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
Delete<T>(Sql)
Declaration
public int Delete<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
Dispose()
Declaration
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
EscapeSqlIdentifier(String)
Declaration
public string EscapeSqlIdentifier(string str)
Parameters
Type |
Name |
Description |
System.String |
str |
|
Returns
Type |
Description |
System.String |
|
EscapeTableName(String)
Declaration
public string EscapeTableName(string str)
Parameters
Type |
Name |
Description |
System.String |
str |
|
Returns
Type |
Description |
System.String |
|
Execute(String, Object[])
Declaration
public int Execute(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Int32 |
|
Execute(Sql)
Declaration
public int Execute(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteScalar<T>(String, Object[])
Declaration
public T ExecuteScalar<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
ExecuteScalar<T>(Sql)
Declaration
public T ExecuteScalar<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type Parameters
Exists<T>(Object)
Declaration
public bool Exists<T>(object primaryKey)
Parameters
Type |
Name |
Description |
System.Object |
primaryKey |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Fetch<T>(Int64, Int64, String, Object[])
Declaration
public List<T> Fetch<T>(long page, long itemsPerPage, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Int64 |
page |
|
System.Int64 |
itemsPerPage |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
Fetch<T>(Int64, Int64, Sql)
Declaration
public List<T> Fetch<T>(long page, long itemsPerPage, Sql sql)
Parameters
Type |
Name |
Description |
System.Int64 |
page |
|
System.Int64 |
itemsPerPage |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
Fetch<T>(String, Object[])
Declaration
public List<T> Fetch<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
Fetch<T>(Sql)
Declaration
public List<T> Fetch<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
Fetch<T1, T2>(String, Object[])
Declaration
public List<T1> Fetch<T1, T2>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Fetch<T1, T2>(Sql)
Declaration
public List<T1> Fetch<T1, T2>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Fetch<T1, T2, TRet>(Func<T1, T2, TRet>, String, Object[])
Declaration
public List<TRet> Fetch<T1, T2, TRet>(Func<T1, T2, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
TRet |
|
Fetch<T1, T2, TRet>(Func<T1, T2, TRet>, Sql)
Declaration
public List<TRet> Fetch<T1, T2, TRet>(Func<T1, T2, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
TRet |
|
Fetch<T1, T2, T3>(String, Object[])
Declaration
public List<T1> Fetch<T1, T2, T3>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
Fetch<T1, T2, T3>(Sql)
Declaration
public List<T1> Fetch<T1, T2, T3>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
Fetch<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet>, String, Object[])
Declaration
public List<TRet> Fetch<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
TRet |
|
Fetch<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet>, Sql)
Declaration
public List<TRet> Fetch<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
TRet |
|
Fetch<T1, T2, T3, T4>(String, Object[])
Declaration
public List<T1> Fetch<T1, T2, T3, T4>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
Fetch<T1, T2, T3, T4>(Sql)
Declaration
public List<T1> Fetch<T1, T2, T3, T4>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
Fetch<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet>, String, Object[])
Declaration
public List<TRet> Fetch<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
TRet |
|
Fetch<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet>, Sql)
Declaration
public List<TRet> Fetch<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
TRet |
|
Fetch<T1, T2, T3, T4, T5>(String, Object[])
Declaration
public List<T1> Fetch<T1, T2, T3, T4, T5>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
Fetch<T1, T2, T3, T4, T5>(Sql)
Declaration
public List<T1> Fetch<T1, T2, T3, T4, T5>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
Fetch<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet>, String, Object[])
Declaration
public List<TRet> Fetch<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, T5, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
TRet |
|
Fetch<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet>, Sql)
Declaration
public List<TRet> Fetch<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, T5, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
TRet |
|
First<T>(String, Object[])
Declaration
public T First<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
First<T>(Sql)
Declaration
public T First<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type Parameters
FirstOrDefault<T>(String, Object[])
Declaration
public T FirstOrDefault<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
FirstOrDefault<T>(Sql)
Declaration
public T FirstOrDefault<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type Parameters
Declaration
public string FormatCommand(IDbCommand cmd)
Parameters
Type |
Name |
Description |
System.Data.IDbCommand |
cmd |
|
Returns
Type |
Description |
System.String |
|
Declaration
public string FormatCommand(string sql, object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.String |
|
GetTransaction()
Declaration
public Transaction GetTransaction()
Returns
GetTransaction(IsolationLevel)
Declaration
public Transaction GetTransaction(IsolationLevel isolationLevel)
Parameters
Type |
Name |
Description |
System.Data.IsolationLevel |
isolationLevel |
|
Returns
Insert(Object)
Declaration
public object Insert(object poco)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
Returns
Type |
Description |
System.Object |
|
Insert(String, String, Boolean, Object)
Declaration
public object Insert(string tableName, string primaryKeyName, bool autoIncrement, object poco)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Boolean |
autoIncrement |
|
System.Object |
poco |
|
Returns
Type |
Description |
System.Object |
|
Insert(String, String, Object)
Declaration
public object Insert(string tableName, string primaryKeyName, object poco)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
Returns
Type |
Description |
System.Object |
|
IsNew(Object)
Declaration
public bool IsNew(object poco)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
Returns
Type |
Description |
System.Boolean |
|
IsNew(String, Object)
Declaration
public bool IsNew(string primaryKeyName, object poco)
Parameters
Type |
Name |
Description |
System.String |
primaryKeyName |
|
System.Object |
poco |
|
Returns
Type |
Description |
System.Boolean |
|
OnBeginTransaction()
Declaration
public virtual void OnBeginTransaction()
OnConnectionClosing(IDbConnection)
Declaration
public virtual void OnConnectionClosing(IDbConnection conn)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
conn |
|
OnConnectionOpened(IDbConnection)
Declaration
public virtual IDbConnection OnConnectionOpened(IDbConnection conn)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
conn |
|
Returns
Type |
Description |
System.Data.IDbConnection |
|
OnEndTransaction()
Declaration
public virtual void OnEndTransaction()
OnException(Exception)
Declaration
public virtual void OnException(Exception x)
Parameters
Type |
Name |
Description |
System.Exception |
x |
|
OnExecutedCommand(IDbCommand)
Declaration
public virtual void OnExecutedCommand(IDbCommand cmd)
Parameters
Type |
Name |
Description |
System.Data.IDbCommand |
cmd |
|
OnExecutingCommand(IDbCommand)
Declaration
public virtual void OnExecutingCommand(IDbCommand cmd)
Parameters
Type |
Name |
Description |
System.Data.IDbCommand |
cmd |
|
OpenSharedConnection()
Declaration
public void OpenSharedConnection()
Page<T>(Int64, Int64, String, Object[])
Declaration
public Page<T> Page<T>(long page, long itemsPerPage, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Int64 |
page |
|
System.Int64 |
itemsPerPage |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
Page<T>(Int64, Int64, Sql)
Declaration
public Page<T> Page<T>(long page, long itemsPerPage, Sql sql)
Parameters
Type |
Name |
Description |
System.Int64 |
page |
|
System.Int64 |
itemsPerPage |
|
Sql |
sql |
|
Returns
Type Parameters
ProcessParams(String, Object[], List<Object>)
Declaration
public static string ProcessParams(string _sql, object[] args_src, List<object> args_dest)
Parameters
Type |
Name |
Description |
System.String |
_sql |
|
System.Object[] |
args_src |
|
System.Collections.Generic.List<System.Object> |
args_dest |
|
Returns
Type |
Description |
System.String |
|
Query<T>(String, Object[])
Declaration
public IEnumerable<T> Query<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
Query<TRet>(Type[], Delegate, String, Object[])
Declaration
public IEnumerable<TRet> Query<TRet>(Type[] types, Delegate cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Type[] |
types |
|
System.Delegate |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Query<T>(Sql)
Declaration
public IEnumerable<T> Query<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
Query<T1, T2>(String, Object[])
Declaration
public IEnumerable<T1> Query<T1, T2>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Query<T1, T2>(Sql)
Declaration
public IEnumerable<T1> Query<T1, T2>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Query<T1, T2, TRet>(Func<T1, T2, TRet>, String, Object[])
Declaration
public IEnumerable<TRet> Query<T1, T2, TRet>(Func<T1, T2, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
TRet |
|
Query<T1, T2, TRet>(Func<T1, T2, TRet>, Sql)
Declaration
public IEnumerable<TRet> Query<T1, T2, TRet>(Func<T1, T2, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
TRet |
|
Query<T1, T2, T3>(String, Object[])
Declaration
public IEnumerable<T1> Query<T1, T2, T3>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
Query<T1, T2, T3>(Sql)
Declaration
public IEnumerable<T1> Query<T1, T2, T3>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
Query<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet>, String, Object[])
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
TRet |
|
Query<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet>, Sql)
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, TRet>(Func<T1, T2, T3, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
TRet |
|
Query<T1, T2, T3, T4>(String, Object[])
Declaration
public IEnumerable<T1> Query<T1, T2, T3, T4>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
Query<T1, T2, T3, T4>(Sql)
Declaration
public IEnumerable<T1> Query<T1, T2, T3, T4>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
Query<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet>, String, Object[])
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
TRet |
|
Query<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet>, Sql)
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, T4, TRet>(Func<T1, T2, T3, T4, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
TRet |
|
Query<T1, T2, T3, T4, T5>(String, Object[])
Declaration
public IEnumerable<T1> Query<T1, T2, T3, T4, T5>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
Query<T1, T2, T3, T4, T5>(Sql)
Declaration
public IEnumerable<T1> Query<T1, T2, T3, T4, T5>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T1> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
Query<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet>, String, Object[])
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet> cb, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, T5, TRet> |
cb |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
TRet |
|
Query<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet>, Sql)
Declaration
public IEnumerable<TRet> Query<T1, T2, T3, T4, T5, TRet>(Func<T1, T2, T3, T4, T5, TRet> cb, Sql sql)
Parameters
Type |
Name |
Description |
System.Func<T1, T2, T3, T4, T5, TRet> |
cb |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TRet> |
|
Type Parameters
Name |
Description |
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
TRet |
|
Save(Object)
Declaration
public void Save(object poco)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
Save(String, String, Object)
Declaration
public void Save(string tableName, string primaryKeyName, object poco)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
Single<T>(Object)
Declaration
public T Single<T>(object primaryKey)
Parameters
Type |
Name |
Description |
System.Object |
primaryKey |
|
Returns
Type Parameters
Single<T>(String, Object[])
Declaration
public T Single<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
Single<T>(Sql)
Declaration
public T Single<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type Parameters
SingleOrDefault<T>(Object)
Declaration
public T SingleOrDefault<T>(object primaryKey)
Parameters
Type |
Name |
Description |
System.Object |
primaryKey |
|
Returns
Type Parameters
SingleOrDefault<T>(String, Object[])
Declaration
public T SingleOrDefault<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type Parameters
SingleOrDefault<T>(Sql)
Declaration
public T SingleOrDefault<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type Parameters
SkipTake<T>(Int64, Int64, String, Object[])
Declaration
public List<T> SkipTake<T>(long skip, long take, string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.Int64 |
skip |
|
System.Int64 |
take |
|
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
SkipTake<T>(Int64, Int64, Sql)
Declaration
public List<T> SkipTake<T>(long skip, long take, Sql sql)
Parameters
Type |
Name |
Description |
System.Int64 |
skip |
|
System.Int64 |
take |
|
Sql |
sql |
|
Returns
Type |
Description |
System.Collections.Generic.List<T> |
|
Type Parameters
SplitSqlForPaging(String, out String, out String, out String)
Declaration
public static bool SplitSqlForPaging(string sql, out string sqlCount, out string sqlSelectRemoved, out string sqlOrderBy)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.String |
sqlCount |
|
System.String |
sqlSelectRemoved |
|
System.String |
sqlOrderBy |
|
Returns
Type |
Description |
System.Boolean |
|
Update(Object)
Declaration
public int Update(object poco)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
Returns
Type |
Description |
System.Int32 |
|
Update(Object, IEnumerable<String>)
Declaration
public int Update(object poco, IEnumerable<string> columns)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
System.Collections.Generic.IEnumerable<System.String> |
columns |
|
Returns
Type |
Description |
System.Int32 |
|
Update(Object, Object)
Declaration
public int Update(object poco, object primaryKeyValue)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
System.Object |
primaryKeyValue |
|
Returns
Type |
Description |
System.Int32 |
|
Update(Object, Object, IEnumerable<String>)
Declaration
public int Update(object poco, object primaryKeyValue, IEnumerable<string> columns)
Parameters
Type |
Name |
Description |
System.Object |
poco |
|
System.Object |
primaryKeyValue |
|
System.Collections.Generic.IEnumerable<System.String> |
columns |
|
Returns
Type |
Description |
System.Int32 |
|
Update(String, String, Object)
Declaration
public int Update(string tableName, string primaryKeyName, object poco)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
Returns
Type |
Description |
System.Int32 |
|
Update(String, String, Object, IEnumerable<String>)
Declaration
public int Update(string tableName, string primaryKeyName, object poco, IEnumerable<string> columns)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
System.Collections.Generic.IEnumerable<System.String> |
columns |
|
Returns
Type |
Description |
System.Int32 |
|
Update(String, String, Object, Object)
Declaration
public int Update(string tableName, string primaryKeyName, object poco, object primaryKeyValue)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
System.Object |
primaryKeyValue |
|
Returns
Type |
Description |
System.Int32 |
|
Update(String, String, Object, Object, IEnumerable<String>)
Declaration
public int Update(string tableName, string primaryKeyName, object poco, object primaryKeyValue, IEnumerable<string> columns)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
primaryKeyName |
|
System.Object |
poco |
|
System.Object |
primaryKeyValue |
|
System.Collections.Generic.IEnumerable<System.String> |
columns |
|
Returns
Type |
Description |
System.Int32 |
|
Update<T>(String, Object[])
Declaration
public int Update<T>(string sql, params object[] args)
Parameters
Type |
Name |
Description |
System.String |
sql |
|
System.Object[] |
args |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
Update<T>(Sql)
Declaration
public int Update<T>(Sql sql)
Parameters
Type |
Name |
Description |
Sql |
sql |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters