public static int Delete <T>(this IDbCommand dbCmd, SqlExpressionVisitor <T> expression) where T : new() { string sql = expression.ToDeleteRowStatement(); return(dbCmd.ExecuteSql(sql)); }
/// <summary> /// Delete the rows that matches the where expression, e.g: /// /// var ev = OrmLiteConfig.DialectProvider.ExpressionVisitor>Person<()); /// dbCmd.Delete<Person>(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)); }