public override int ExecuteNonQuery()
            {
                SetCommand(true);

                var queryContext = Query.Queries[QueryNumber];

                var q = _dataContext.GetSqlOptimizer().OptimizeStatement(queryContext.Statement, _dataContext.MappingSchema);

                var data = LinqServiceSerializer.Serialize(
                    q,
                    q.IsParameterDependent ? q.Parameters.ToArray() : queryContext.GetParameters(),
                    QueryHints);

                if (_dataContext._batchCounter > 0)
                {
                    _dataContext._queryBatch.Add(data);
                    return(-1);
                }

                _client = _dataContext.GetClient();

                return(_client.ExecuteNonQuery(_dataContext.Configuration, data));
            }
            public override async Task <IDataReaderAsync> ExecuteReaderAsync(CancellationToken cancellationToken)
            {
                if (_dataContext._batchCounter > 0)
                {
                    throw new LinqException("Incompatible batch operation.");
                }

                SetCommand(true);

                var queryContext = Query.Queries[QueryNumber];

                _client = _dataContext.GetClient();

                var q   = queryContext.SelectQuery.ProcessParameters(_dataContext.MappingSchema);
                var ret = await _client.ExecuteReaderAsync(
                    _dataContext.Configuration,
                    LinqServiceSerializer.Serialize(
                        q,
                        q.IsParameterDependent ? q.Parameters.ToArray() : queryContext.GetParameters(),
                        QueryHints));

                return(new DataReaderAsync(_dataContext, ret, SkipAction, TakeAction));
            }