コード例 #1
0
ファイル: EventFetcher.cs プロジェクト: zero5two4/epcis
        public async Task <IEnumerable <EpcisEvent> > Fetch(CancellationToken cancellationToken)
        {
            _parameters.SetLimit(_limit ?? int.MaxValue);
            _query = _filters.ContainsFilters ? _query.Where(_filters.GetSqlFilters()) : _query;
            _query = _query.OrderBy($"{_orderField.ToPgSql()} {_orderDirection.ToPgSql()}");

            using var reader = await _connection.QueryMultipleAsync(new CommandDefinition (_sqlTemplate.RawSql, _parameters.Values, cancellationToken : cancellationToken));

            var eventDtoManager = await EventDtoManager.ReadAsync(reader, cancellationToken);

            return(eventDtoManager.FormatEvents());
        }
コード例 #2
0
 public void OrderBy(EpcisField field, OrderDirection direction) => _query.OrderBy($"{field.ToPgSql()} {direction.ToPgSql()}");