Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
 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));
     }
 }
Esempio n. 3
0
 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));
     }
 }
Esempio n. 4
0
 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));
     }
 }
Esempio n. 5
0
 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));
     }
 }
Esempio n. 6
0
 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);
     }
 }
Esempio n. 7
0
 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));
     }
 }
Esempio n. 8
0
        public Database(string connKey)
        {
            this.ConnKey = connKey;
            DataBaseType dbType;

            Connection  = DBUtils.CreateDBConnection(connKey, out dbType);
            this.dbType = dbType;
        }
Esempio n. 9
0
 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));
     }
 }
Esempio n. 10
0
 public Database(DataBaseType dbType, string connKey)
 {
     this.ConnKey    = connKey;
     this.dbType     = dbType;
     this.Connection = DBUtils.CreateDBConnection(dbType, connKey);
 }