/// <summary>
        /// 批量删除
        /// </summary>
        public static async Task <int> DeleteAsync <T>(this DbConnection connection, IEnumerable <T> objList, DbTransaction transaction) where T : BaseEntity
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (objList == null)
            {
                throw new ArgumentNullException(nameof(objList));
            }
            if (transaction == null)
            {
                throw new ArgumentNullException(nameof(transaction));
            }
            int count = 0;

            using (DbCommand command = connection.CreateCommand())
            {
                command.Transaction = transaction;
                command.CommandText = CodeSegmentHelper.GenerateDeleteSql <T>();
                foreach (var item in objList)
                {
                    if (item != null)
                    {
                        command.Parameters.Clear();
                        command.AppendEntityParameters <T>(item);
                        int result = await command.ExecuteNonQueryAsync();

                        count = result + count;
                    }
                }
            }
            return(count);
        }
        /// <summary>
        /// 从数据库中删除一个对象
        /// </summary>
        public static async Task <int> DeleteAsync <T>(this DbConnection connection, T obj, DbTransaction transaction = null) where T : BaseEntity
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }
            TableMapper tableMapper = MappingCachePool.GetOrAdd <T>();

            using (DbCommand command = connection.CreateCommand())
            {
                if (transaction != null)
                {
                    command.Transaction = transaction;
                }
                command.CommandText = CodeSegmentHelper.GenerateDeleteSql <T>();
                command.Parameters.Clear();
                command.AppendEntityParameters <T>(obj);
                return(await command.ExecuteNonQueryAsync());
            }
        }