Skip to content

Commit

Permalink
Fix indexers on DataReaderAdapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkPflug committed Jul 1, 2024
1 parent a3af120 commit 6907d7e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/Data/Sylvan.Data.Releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Sylvan.Data Release Notes

_0.2.16_
- Fixes the base DataReaderAdapter indexer implementations to defer to GetOrdinal/GetName rather than the wrapper reader implementations.

_0.2.15_
- Adds async support to a few DbDataReader implementations that were previously missing it. This lead to incorrect behavior when used asynchronously.

Expand Down
4 changes: 2 additions & 2 deletions source/Sylvan.Data/DataReaderAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public DataReaderAdapter(DbDataReader dr)
}

/// <inheritdoc/>
public override object this[int ordinal] => dr[ordinal];
public override object this[int ordinal] => this.GetValue(ordinal);

/// <inheritdoc/>
public override object this[string name] => dr[name];
public override object this[string name] => this.GetValue(this.GetOrdinal(name));

/// <inheritdoc/>
public override int Depth => dr.Depth;
Expand Down
2 changes: 1 addition & 1 deletion source/Sylvan.Data/Sylvan.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<VersionPrefix>0.2.15</VersionPrefix>
<VersionPrefix>0.2.16</VersionPrefix>
<Description>A .NET library of types for working with data objects.</Description>
<PackageTags>data;datareader;ADO.NET</PackageTags>
<Nullable>enable</Nullable>
Expand Down
5 changes: 0 additions & 5 deletions source/Sylvan.Data/ValidatingDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,6 @@ void ClearError(int ordinal)
this.errorMarker[ordinal] = -1;
}


public override object this[int ordinal] => GetValue(ordinal);

public override object this[string name] => this.GetValue(GetOrdinal(name));

public override int Depth => 0;

public override int FieldCount => inner.FieldCount;
Expand Down

0 comments on commit 6907d7e

Please sign in to comment.