public IEnumerable <DomainEvent> Get(Guid aggregateId, int fromVersion)
        {
            var aggregates = _queryStore.Query <PersistedDomainEvent>(new []
            {
                QueryElement.FieldEquals("EventId", aggregateId.ToString()),
                QueryElement.FieldCompare("Version", FieldComparison.GreaterEquals, fromVersion),
            });

            return(aggregates.OrderBy(x => x.Version).Select(x => x.Source).ToList());
        }
示例#2
0
        public void TestNothingWhenNotFound()
        {
            var query  = QueryElement.FieldEquals("Version", 1);
            var result = QueryStore.Query <QueryableTestObject>(query);

            Assert.AreEqual(0, result.Count());
        }
        public IEnumerable <DomainResult> GetForTracking(string trackingId)
        {
            var toReturn = _persistanceQuery.Query <DomainResult>(QueryElement.FieldEquals("TrackingId", trackingId));

            return(toReturn);
        }