Skip to content

Commit

Permalink
Check for no results in ResultEnumerator
Browse files Browse the repository at this point in the history
Fixes #16099
  • Loading branch information
ajcvickers committed Jul 30, 2019
1 parent 33f8699 commit 25a1d38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ private sealed class ResultEnumerator : IEnumerator<ValueBuffer>
private readonly ValueBuffer _value;
private bool _moved;

public ResultEnumerator(ValueBuffer value) => _value = value;
public ResultEnumerator(ValueBuffer value)
{
_value = value;
_moved = _value.IsEmpty;
}

public bool MoveNext()
{
Expand Down
6 changes: 3 additions & 3 deletions test/EFCore.InMemory.FunctionalTests/FindInMemoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected FindInMemoryTest(FindInMemoryFixture fixture)
{
}

internal class FindInMemoryTestSet : FindInMemoryTest
public class FindInMemoryTestSet : FindInMemoryTest
{
public FindInMemoryTestSet(FindInMemoryFixture fixture)
: base(fixture)
Expand All @@ -27,7 +27,7 @@ protected override ValueTask<TEntity> FindAsync<TEntity>(DbContext context, para
=> context.Set<TEntity>().FindAsync(keyValues);
}

internal class FindInMemoryTestContext : FindInMemoryTest
public class FindInMemoryTestContext : FindInMemoryTest
{
public FindInMemoryTestContext(FindInMemoryFixture fixture)
: base(fixture)
Expand All @@ -41,7 +41,7 @@ protected override ValueTask<TEntity> FindAsync<TEntity>(DbContext context, para
=> context.FindAsync<TEntity>(keyValues);
}

internal class FindInMemoryTestNonGeneric : FindInMemoryTest
public class FindInMemoryTestNonGeneric : FindInMemoryTest
{
public FindInMemoryTestNonGeneric(FindInMemoryFixture fixture)
: base(fixture)
Expand Down

0 comments on commit 25a1d38

Please sign in to comment.