public async Task ShouldQueryByMappedIndex()
{
_store.RegisterIndexes<PersonIndexProvider>();
using (var session = _store.CreateSession())
{
var bill = new Person
{
Firstname = "Bill",
Lastname = "Gates",
};
var steve = new Person
{
Firstname = "Steve",
Lastname = "Balmer"
};
session.Save(bill);
session.Save(steve);
}
using (var session = _store.CreateSession())
{
Assert.Equal(2, await session.QueryAsync().For<Person>().With<PersonByName>().Count());
Assert.Equal(1, await session.QueryAsync().For<Person>().With<PersonByName>(x => x.Name == "Steve").Count());
Assert.Equal(1, await session.QueryAsync().For<Person>().With<PersonByName>().Where(x => x.Name == "Steve").Count());
}
}