public static IMultipleResultReader GetMultiple(string connKey, GetMultiplePredicate predicate, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(GetMultiple(conn, predicate, null, commandTimeout, dbType)); } }
public static IEnumerable <T> GetPage <T>(string connKey, object predicate, IList <ISort> sort, int page, int resultsPerPage, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(GetPage <T>(conn, predicate, sort, page, resultsPerPage, null, commandTimeout, dbType)); } }
public static int Count <T>(string connKey, object predicate, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(Count <T>(conn, predicate, null, commandTimeout, dbType)); } }
public static IEnumerable <T> GetPage <T>(string connKey, int page, int resultsPerPage, out long allRowsCount, string sql, dynamic param = null, string allRowsCountSql = null, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(GetPage <T>(conn, page, resultsPerPage, out allRowsCount, sql, param, allRowsCountSql, null, commandTimeout, dbType)); } }
public static int Delete <T>(string connKey, T entity, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(Delete <T>(conn, entity, null, commandTimeout, dbType)); } }
public static void Insert <T>(string connKey, IEnumerable <T> entities, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { Insert <T>(conn, entities, null, commandTimeout, dbType); } }
public static T Get <T>(string connKey, dynamic id, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(Get <T>(conn, id, null, commandTimeout, dbType)); } }
public static IEnumerable <TReturn> GetList <T, TReturn>(string connKey, object predicate = null, IList <ISort> sort = null, int?commandTimeout = null, DataBaseType dbType = DefaultDBType) where T : class where TReturn : class { using (IDbConnection conn = DBUtils.CreateDBConnection(dbType, connKey)) { return(GetList <T, TReturn>(conn, predicate, sort, null, commandTimeout, dbType)); } }
public Database(DataBaseType dbType, string connKey) { this.ConnKey = connKey; this.DbType = dbType; this.Connection = DBUtils.CreateDBConnection(dbType, connKey); }
public Database(string connKey) { this.ConnKey = connKey; Connection = DBUtils.CreateDBConnection(connKey, out DataBaseType dbType); this.DbType = dbType; }