Interface IQueryResult<TValue>
- Assembly
- Diffusion.Client.dll
The query result providing a stream of events.
public interface IQueryResult<TValue>
Type Parameters
TValueThe query value type.
Remarks
Added in version 6.1.
Properties
Events
Gets the events as a System.Collections.Generic.IEnumerable{T}.
IEnumerable<IEvent<TValue>> Events { get; }
Property Value
- IEnumerable<IEvent<TValue>>
The events as a
System.Collections.Generic.IEnumerable{T}interface. Instances benefit from the various combinator and reduction methods provided bySystem.Linq.
IsComplete
Returns whether this result includes all events selected by the query.
bool IsComplete { get; }
Property Value
- bool
trueif SelectedCount is equal to the amount of events in Events. Otherwisefalse.
SelectedCount
Gets the number of events selected by the query.
long SelectedCount { get; }
Property Value
- long
The number of events selected by the query.
Remarks
This number may be greater than Stream.Count() due to a
policy of the time series topic to limit the number of returned
results, or the use of Limit(long).
StreamStructure
Gets the structure of the events.
StreamStructure StreamStructure { get; }
Property Value
- StreamStructure
The stream structure of the provided events.
Methods
Merge(IQueryResult<TValue>)
Merges this result with other, combining original events and
edit events, to produce an IQueryResult<TValue>
of type VALUE_EVENT_STREAM.
IQueryResult<TValue> Merge(IQueryResult<TValue> other)
Parameters
otherIQueryResult<TValue>The other query result to merge with.
Returns
- IQueryResult<TValue>
The newly merged query result.
Remarks
The following rules are applied to calculate the result:
-
If this result and
otherhave an event with equal sequence numbers, the event fromotheris selected. - An edit event is selected in place of its original event.
- If there are multiple edit events of an original edit, the one with the highest sequence is selected.
The returned result implements IsComplete
to return true and SelectedCount
to return the count of events in the stream, regardless of whether this result is complete.
Exceptions
- ArgumentNullException
otherisnull.