Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ Release notes - NHibernate - Version 5.1.0
As part of releasing 5.1.0, a missing 5.0.0 possible breaking change has been added about inequality semantic in LINQ
queries. See 5.0.0 possible breaking changes.

Build 5.0.5
=============================

Release notes - NHibernate - Version 5.0.5

** Bug
* #1665 Have IFutureEnumerable.GetEnumerable executing immediatly the query

Build 5.0.4
=============================

Expand Down
20 changes: 20 additions & 0 deletions src/NHibernate.Test/Async/Futures/FutureQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,25 @@ public async Task CanExecuteMultipleQueryWithSameParameterNameAsync()
}
}
}

[Test]
public async Task FutureExecutedOnGetEnumerableAsync()
{
Sfi.Statistics.IsStatisticsEnabled = true;
try
{
using (var s = Sfi.OpenSession())
{
var persons = s.CreateQuery("from Person").Future<Person>();
Sfi.Statistics.Clear();
await (persons.GetEnumerableAsync());
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
}
}
finally
{
Sfi.Statistics.IsStatisticsEnabled = false;
}
}
}
}
20 changes: 20 additions & 0 deletions src/NHibernate.Test/Futures/FutureQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,25 @@ public void CanExecuteMultipleQueryWithSameParameterName()
}
}
}

[Test]
public void FutureExecutedOnGetEnumerable()
{
Sfi.Statistics.IsStatisticsEnabled = true;
try
{
using (var s = Sfi.OpenSession())
{
var persons = s.CreateQuery("from Person").Future<Person>();
Sfi.Statistics.Clear();
persons.GetEnumerable();
Assert.That(Sfi.Statistics.PrepareStatementCount, Is.EqualTo(1));
}
}
finally
{
Sfi.Statistics.IsStatisticsEnabled = false;
}
}
}
}
6 changes: 1 addition & 5 deletions src/NHibernate/Impl/DelayedEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ public DelayedEnumerator(GetResult result, GetResultAsync resultAsync)

public IEnumerable<T> GetEnumerable()
{
var value = _result();
foreach (T item in value)
{
yield return item;
}
return _result();
}

// Remove in 6.0
Expand Down