I have the following code:
public IEnumerable<MyClass> GetFirstData()
{
return session.CreateCriteria<MyClass>()
// ICriterions here
.Future<MyClass>();
}
public IEnumerable<MyClass> GetSecondData()
{
return session.CreateCriteria<MyClass>()
// different ICriterions here
.Future<MyClass>();
}
then:
var firstData = GetFirstData();
var secondData = GetSecondData();
foreach(var item in secondData)
// whatever
But when this executes NHProf shows the two queries executing separately. Should I expect these to be performed in the same batch (database round-trip)? What am I doing wrong?
Thanks