Пример #1
0
        public IEnumerable <Query.Document> Search(Query.Document.Specification specification)
        {
            Guard.AgainstNull(specification, nameof(specification));

            var result = _queryMapper.MapObjects <Query.Document>(_queryFactory.Search(specification))
                         .ToDictionary(document => document.Id);

            if (specification.StatusEventsIncluded && result.Any())
            {
                foreach (var mappedRow in _queryMapper.MapRows <Query.Document.StatusEvent>(_queryFactory.GetStatusEvents(result.Keys)))
                {
                    if (result.TryGetValue(Columns.DocumentId.MapFrom(mappedRow.Row), out var document))
                    {
                        document.StatusEvents.Add(mappedRow.Result);
                    }
                }
            }

            if (specification.PropertiesIncluded && result.Any())
            {
                foreach (var mappedRow in _queryMapper.MapRows <Query.Document.Property>(query: _queryFactory.GetProperties(result.Keys)))
                {
                    if (result.TryGetValue(Columns.DocumentId.MapFrom(mappedRow.Row), out var document))
                    {
                        document.Properties.Add(mappedRow.Result);
                    }
                }
            }

            return(result.Values);
        }
 public IEnumerable <MessageTypeDispatched> Search(string match)
 {
     return(_queryMapper.MapObjects <MessageTypeDispatched>(_queryFactory.Search(match)));
 }
Пример #3
0
 public IEnumerable <PrimitiveEvent> Get(Guid id)
 {
     return(_queryMapper.MapObjects <PrimitiveEvent>(_queryFactory.GetEventStream(id)));
 }
Пример #4
0
 public IEnumerable <Queue> All()
 {
     return(_queryMapper.MapObjects <Queue>(_queryFactory.All()));
 }
 public IEnumerable <MessageHeader> All()
 {
     return(_queryMapper.MapObjects <MessageHeader>(_queryFactory.All()));
 }
Пример #6
0
 public IEnumerable <Subscription> All()
 {
     return(_queryMapper.MapObjects <Subscription>(_queryFactory.All()));
 }
 public IEnumerable <MessageTypeAssociation> Search(string match)
 {
     return(_queryMapper.MapObjects <MessageTypeAssociation>(_queryFactory.Search(match)));
 }
 public IEnumerable <MessageTypeMetric> Search(DateTime @from, string match)
 {
     return(_queryMapper.MapObjects <MessageTypeMetric>(_queryFactory.Search(@from, match)));
 }
 public IEnumerable <Endpoint> All()
 {
     return(_queryMapper.MapObjects <Endpoint>(_queryFactory.All()));
 }