コード例 #1
0
        public IReadOnlyList <SqlBuilderResultRow> ToResults(string query, IDictionary <string, object?> parameters)
        {
            var cmd = BuildCommand(query, parameters);

            var results = new List <SqlBuilderResultRow>();

            using (var reader = cmd.ExecuteReader()) {
                while (reader.Read())
                {
                    results.Add(SqlBuilderResultRow.FromReader(reader));
                }
            }
            return(results.AsReadOnly());
        }
コード例 #2
0
ファイル: MySqlFlavor.cs プロジェクト: Mattias1/ddd-draughts
        public async Task <IReadOnlyList <SqlBuilderResultRow> > ToResultsAsync(
            string query, IDictionary <string, object?> parameters)
        {
            using (_connection) {
                await _connection.OpenAsync();

                var cmd = BuildCommand(query, parameters);

                var results = new List <SqlBuilderResultRow>();
                using (var reader = await cmd.ExecuteReaderAsync()) {
                    while (await reader.ReadAsync())
                    {
                        results.Add(SqlBuilderResultRow.FromReader(reader));
                    }
                }
                return(results.AsReadOnly());
            }
        }