samedi 29 octobre 2016

C# SqlDataReader interface with HasRows, Read() and NextResult()

I am trying to find an interface which is implemented by SqlDataReader and which exposes HasRows, Read() and NextResult(). I need these property and methods because I need to read multiple resultSets returned by stored procedures (as mentioned here). Currently I am using System.Data.IDataReader which exposes Read() and NextResult() but not HasRows property.

I need an interface so that the coupling will be lose and for the sake of code testability.

Any help on such an interface? Or I'll need to write an abstraction layer of interface from scratch?

Aucun commentaire:

Enregistrer un commentaire