public override async Task <int> InternalExecuteAsync(DbQueryResult param)
        {
            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(param.SqlParameters);
            var result            = await dbConnection.ExecuteAsync(param.Sql, dynamicParameters, dbTransaction);

            CloseDb();
            return(result);
        }
        public override int InternalExecute(DbQueryResult param)
        {
            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(param.SqlParameters);
            var result            = dbConnection.Execute(param.Sql, dynamicParameters, dbTransaction);

            CloseDb();
            return(result);
        }
        public override List <TResult> InternalQueryList <TResult>(DbQueryResult param)
        {
            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(param.SqlParameters);

            var result = dbConnection.Query <TResult>(param.Sql, dynamicParameters, dbTransaction).ToList();

            CloseDb();
            return(result);
        }
        public override TResult InternalQuery <TResult>(DbQueryResult param)
        {
            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(param.SqlParameters);

            var result = dbConnection.QueryFirstOrDefault <TResult>(param.Sql, dynamicParameters, dbTransaction);

            CloseDb();
            return(result);
            //return result.FirstOrDefault();
        }
        public async Task <T> GetAsync(dynamic id)
        {
            DbQueryResult internalResult = InternalGet(id);

            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(internalResult.SqlParameters);

            var result = await dbConnection.QueryFirstOrDefaultAsync <T>(internalResult.Sql, dynamicParameters, transaction : dbTransaction);

            CloseDb();
            return(result);
        }
        public override Page <TResult> InternalQueryPage <TResult>(DbQueryResult param)
        {
            OpenDb();
            var dynamicParameters = ChangeDynamicParameters(param.SqlParameters);

            var count = dbConnection.QueryFirst <int>(param.CountSql, dynamicParameters, dbTransaction);
            var item  = dbConnection.Query <TResult>(param.Sql, dynamicParameters, dbTransaction);

            CloseDb();
            var result = new Page <TResult>()
            {
                Data       = item.ToList(),
                TotalPages = count
            };

            return(result);
        }