Пример #1
0
        public static async Task <List <object> > readAll(ReadRequest request)
        {
            using (var connection = new SqlConnection(request.connectionString))
            {
                await connection.OpenAsync().ConfigureAwait(false);

                return((await connection.QueryAsync <object>(
                            request.sql, null, null, 600, null)
                        .ConfigureAwait(false)).ToList <object>());
            }
        }
Пример #2
0
        static void doWork(Command command)
        {
            var query  = ReadRequest.create(command);
            var output = BulkOutputRequest.create(command);

            output.documents = InputReader.read(query).Result;
            var writer = new OutputWriter();

            if (command.isRecreateIndex)
            {
                writer.ResetIndex(output);
            }

            while (output.hasData())
            {
                writer.write(output);
                query.page++;
                output.documents = InputReader.read(query).Result;
            }
        }