public void IndexHasLinkToDocuments() { _store.RegisterIndexes<ArticleIndexProvider>(); using (var session = _store.CreateSession()) { var d1 = new Article { PublishedUtc = new DateTime(2011, 11, 1) }; var d2 = new Article { PublishedUtc = new DateTime(2011, 11, 1) }; session.Save(d1); session.Save(d2); } using (var session = _store.CreateSession()) { var articles = session.Load<Article>(); Assert.Equal(2, articles.Count()); } }
public async Task ChangesAreAutoFlushed() { _store.RegisterIndexes<ArticleIndexProvider>(); using (var session = _store.CreateSession()) { var d1 = new Article { PublishedUtc = new DateTime(2011, 11, 1) }; var d2 = new Article { PublishedUtc = new DateTime(2011, 11, 1) }; session.Save(d1); session.Save(d2); var articles = session.QueryAsync<Article, ArticlesByDay>(x => x.DayOfYear == 305); Assert.Equal(2, await articles.Count()); } }