diff --git a/src/Microsoft.Data.Sqlite/SqliteDataReader.cs b/src/Microsoft.Data.Sqlite/SqliteDataReader.cs index 59d175f3835..9eda3895396 100644 --- a/src/Microsoft.Data.Sqlite/SqliteDataReader.cs +++ b/src/Microsoft.Data.Sqlite/SqliteDataReader.cs @@ -116,14 +116,7 @@ public override object this[int ordinal] /// /// The enumerator. public override IEnumerator GetEnumerator() - { -#if NET451 - return new DbEnumerator(this); -#else - // TODO: Remove when the System.Data.Common includes DbEnumerator - throw new NotImplementedException(); -#endif - } + => new DbEnumerator(this, closeReader: false); /// /// Advances to the next row in the result set. diff --git a/test/Microsoft.Data.Sqlite.Tests/SqliteDataReaderTest.cs b/test/Microsoft.Data.Sqlite.Tests/SqliteDataReaderTest.cs index 5a7581a765f..79cfd24bff0 100644 --- a/test/Microsoft.Data.Sqlite.Tests/SqliteDataReaderTest.cs +++ b/test/Microsoft.Data.Sqlite.Tests/SqliteDataReaderTest.cs @@ -179,24 +179,6 @@ public void GetDouble_throws_when_null() => GetX_throws_when_null( r => r.GetDouble(0)); -#if NETCOREAPP1_0 - [Fact] - public void GetEnumerator_not_implemented() - { - using (var connection = new SqliteConnection("Data Source=:memory:")) - { - connection.Open(); - - using (var reader = connection.ExecuteReader("SELECT 1;")) - { - var hasData = reader.Read(); - Assert.True(hasData); - - Assert.Throws(() => reader.GetEnumerator()); - } - } - } -#else [Fact] public void GetEnumerator_works() { @@ -213,7 +195,6 @@ public void GetEnumerator_works() } } } -#endif [Theory] [InlineData("SELECT 1;", true)]