Esempio n. 1
0
        /// <summary>
        /// 存在于表中
        /// </summary>
        /// <param name="columnName"></param>
        /// <returns></returns>
        private bool ColumnInTable(string columnName)
        {
            var tableSplited = TableName.Split('.');
            var objectName   = TableName;

            if (tableSplited.Length != 1)
            {
                objectName = tableSplited[tableSplited.Length - 1];
            }
            var existInTable = @"SELECT * FROM sys.[columns] WHERE [object_id] = (SELECT TOP 1 [object_id] FROM sys.[objects] WHERE name = '{0}') AND  NAME = N'{1}'"
                               .Fill(objectName, columnName);

            return(DbDapper.Count(existInTable) > 0);
        }
Esempio n. 2
0
 public virtual int Count(string sql, object param)
 {
     return(DbDapper.Count(sql, param, DbConnection, DbTransaction));
 }
Esempio n. 3
0
 public virtual int Count(string where = "")
 {
     return(DbDapper.Count <T>(where, DbConnection, DbTransaction));
 }