Example #1
0
        public static void ExecDelete(this IDbConnection con, string sTableName, long ID, IDbTransaction tran = null)
        {
            string sql = DynamicQuery.GetDeleteQuery(sTableName);

            con.Execute(sql, new { ID }, tran);
        }
Example #2
0
        public static long ExecInsertWithID(this IDbConnection con, string sTableName, dynamic param, IDbTransaction tran = null)
        {
            string sql = DynamicQuery.GetInsertQueryWithID(sTableName, param);

            return(con.Execute(sql, (object)param, tran));
        }
Example #3
0
        public static void ExecUpdate(this IDbConnection con, string sTableName, dynamic param, IDbTransaction tran = null)
        {
            string sql = DynamicQuery.GetUpdateQuery(sTableName, param);

            con.Execute(sql, (object)param, tran);
        }
Example #4
0
        public static long ExecInsert(this IDbConnection con, string sTableName, dynamic param, IDbTransaction tran = null)
        {
            string sql = DynamicQuery.GetInsertQuery(sTableName, param, false);

            return(con.Query <int>(sql, (object)param, tran).FirstOrDefault());
        }