public IList <Customer> FindAllCustomersByFirstName(string firstName) { using (var session = _documentStore.QuerySession()) { var query = new FindAllCustomersByFirstNameCompiledQuery(firstName); //TODO tolistasync is not working here return(session.Query(query).ToList()); //.ToListAsync(); } }
//TODO investigate batched queries public void BatchQuery() { using (var session = _documentStore.QuerySession()) { IBatchedQuery batch = session.CreateBatchQuery(); var query = new FindAllCustomersByFirstNameCompiledQuery("abc"); var result = batch.Query(query); batch.ExecuteSynchronously(); } }