Are we using CreateTransientAsync correctly?

Struggling with an issue, and hoped someone on here could shed some light on it.
It might be we are using the software incorrectly.

Event Store Version:

EventStore.Client: 3.0.2

We have a Continuous Projection (called AllSales) and want to perform an adhoc query on in (get the total sum of sales performed today):

Here is the query:



$init: function (s, e) {

return {

total: 0, count: 0



‘Tahoe.Eposity.DomainEvents.SalesTransactionLineAddedEvent’: function (s, e) {

var today = new Date(‘2015-09-01’);

var eventDate = new Date(;

if (today.getDate() == eventDate.getDate() &&

today.getMonth() == eventDate.getMonth() &&

today.getFullYear() == eventDate.getFullYear()) { +=;

s.count ++;




In our C# code, we have a prototype to show the issue:



String queryname = Guid.NewGuid().ToString();

projectionsManager = new ProjectionsManager(new ConsoleLogger(), new IPEndPoint(address, 2113), TimeSpan.FromSeconds(10));

await projectionsManager.CreateTransientAsync(queryname, query, credentials);

var result = await projectionsManager.GetStateAsync(queryname, credentials);




The first time round the loop, the result contains what looks like the expected value, however, all subsequent iterations just seem like strange values (a lot of repeating values):











Are doing something fundamentally wrong?

In addition, if we chang fromAll() to fromStream(‘AllSales’) we get no results, even though that is the correct stream name.

If we take the javascript query, and run it from the Admin GUI, we always get the expected values.

Any help in this matter would be appreciated.


Does anyone use CreateTransientAsync?

This is a show stopper for us, because the results returned from GetStateAsync changes each time we make calls in short succession.

The main issue is we are unsure if it’s a lack of understanding on our part, or if there is a problem with the .NET Driver.

Running the query manually from the Admin GUI produces the expected results (every time).


Ok, we got this issue sorted finally!

For anyone else interested, the problem was our assumption that CreateTransientAsync (even using await) does not actually return when the query is ready to run.

If you then call GetStatusAsync and keep checking the status (it will become completed shortly after) then call GetStateAsync.

Hope that makes sense.

Ah, yes the async applies to the HTTP operation not the underlying projection operation (there is no mechanism to implement this in ES at the moment). I guess there might be space for a higher level API encapsulating this implemented in the terms you mention here too.

Yeah, in our API for making these kind of calls, we just hide the fact keep checking the status so to the user, it looks like they make a call to fire a query and get the response all in one go.

I’ve opened to track this.