コード例 #1
0
 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();
     }
 }
コード例 #2
0
        //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();
            }
        }