예제 #1
0
        public static int Delete <T>(this IDbCommand dbCmd, SqlExpressionVisitor <T> expression)
            where T : new()
        {
            string sql = expression.ToDeleteRowStatement();

            return(dbCmd.ExecuteSql(sql));
        }
예제 #2
0
        /// <summary>
        /// Delete the rows that matches the where expression, e.g:
        ///
        ///   var ev = OrmLiteConfig.DialectProvider.ExpressionVisitor&gt;Person&lt;());
        ///   dbCmd.Delete&lt;Person&gt;(ev.Where(p => p.Age == 27));
        ///   DELETE FROM "Person" WHERE ("Age" = 27)
        /// </summary>
        public static int Delete <T>(this IDbCommand dbCmd, SqlExpressionVisitor <T> where)
        {
            var sql = where.ToDeleteRowStatement();

            return(dbCmd.ExecuteSql(sql));
        }