Request for clarification on System.Data DbDataRecord / DbDataReader #4646

Closed
mgravell opened this Issue Nov 24, 2015 · 5 comments

Projects

None yet

4 participants

@mgravell
Contributor

DbDataReader has a GetEnumerator() API which is intended to return an IEnumerable that exposes IDataRecord (often: DbDataRecord) - this is often implemented via DbEnumerator.

On core-clr at the current time, DbDataReader has an abstract IEnumerator GetEnumerator() method that must be overridden. However, without DbDataRecord or DbEnumerator, it is unclear how this is meant to be done in any way. I've checked the SqlDataReader code, and it currently refers to a local copy of a publicly declared DbEnumerator (et al), but these public declarations do not seem to be accessible on the currently published packages.

So; can someone clarify this?

a: is this abstract method an accidental inclusion that should have been dropped in the core-clr API? or
b: is this meant to be there, but the required APIs to do it are in the wrong place and not yet available?

Assuming "b", is there a timescale to get this into place so we can verify again the proposed API?

@joshfree joshfree added this to the 1.0.0-rc2 milestone Nov 24, 2015
@saurabh500 saurabh500 was assigned by joshfree Nov 24, 2015
@YoungGah YoungGah assigned YoungGah and unassigned saurabh500 Dec 3, 2015
@joshfree
Member
@joshfree joshfree modified the milestone: 1.0.0-rtm, 1.0.0-rc2 Mar 29, 2016
@YoungGah
Member

@mgravell, DbDataReader.GetEnumerator was intentionally included in corefx. However, as you pointed out, it is hard to implement it without DbDataRecord and DbEnumerator. We had challenges using DbEnumerator as it only took IDataReader into its contractors prior to .NET Framework 4.5.2, and we didn't implement interfaces in corefx originally. We temporally worked around the issue by including DbDataRecord and DbEnumerator in System.Data.SqlClient, but did not expose the contract as they don't belong to SqlClient. Since we have interfaces now, we will move DbDataRecord and DbEnumerator into System.Data.Common.dll and expose the contract accordingly.

@mgravell
Contributor

Thanks; that'll be great.

@saurabh500 saurabh500 modified the milestone: 1.0.0-rtm, 1.1.0 May 4, 2016
@joshfree joshfree assigned saurabh500 and unassigned YoungGah May 8, 2016
@joshfree joshfree added the question label May 8, 2016
@saurabh500
Member

DbDataRecord and DbEnumerator have been added to System.Data.Common for RTM.

@saurabh500 saurabh500 closed this May 9, 2016
@mgravell
Contributor

Much obliged.
On 10 May 2016 12:10 am, "Saurabh Singh" notifications@github.com wrote:

Closed #4646 #4646.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#4646 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment