Esempio n. 1
0
        /// <summary>
        /// 返回影响的行数
        /// </summary>
        /// <returns></returns>
        public int ExecuteNonQuery(IDbTransaction trans = null)
        {
            if (_dbQueryables.Count != 1)
            {
                throw new XfwException("Only one 'IDbQueryable' accept.");
            }

            try
            {
                List <string> sqlList = this.Resolve(false);
                return(_provider.ExecuteNonQuery(sqlList[0], trans));
            }
            catch
            {
                if (trans != null)
                {
                    trans.Rollback();
                }
                throw;
            }
            finally
            {
                this.Dispose();
            }
        }