Hi,
Evaluating DO I tried to play with the future queries to reduce the number of round-trips to the database, but got an exception in a very simple scenario.
This is an example that reproduces the problem.
static void Test()
{
var config = DomainConfiguration.Load("Default");
var domain = Domain.Build(config);
using (var session = domain.OpenSession())
{
using (var transactionScope = session.OpenTransaction())
{
Key key = Key.Create<Item>(domain, 1);
var item = session.Query.ExecuteDelayed(x => x.Single<Item>(key));
}
}
}
The problem though can be solved by the following code (which just doesn't look as straightforward as the example above):
var item = session.Query.ExecuteDelayed(x => x.All<Item>().Single(i => i.Key == key));
asked
Jan 28 '12 at 17:23
Anton
9●3●3●5