-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple enumerations of IEnumerable<SqlDataRecord> passed as TVP #2064
Comments
Ah, I got the idea, you are trying to avoid exception when the enumerable is empty. |
I'm inclined to agree; at best we should type-test for |
Let's say I have any source of enumerable: db reader, http returning IAsyncEnumerable, grpc streaming, whatever |
yes, I understand and agree; the point is that what we should change here is basically:
In your case, the type-test will fail, so we'll just fall into the |
Great, thank you P.S. on a second thought catching the exception is a bad idea, because sql will not be executed and caller should know about that |
Looks like Dapper twice enumerates IEnumerable passed as TVP
this code writes to console
0
0
1
2
and if I pass enumerable from database it throws exception because can not open second reader on same connection (same enumerable works fine using ADO.Net)
I believe this is the first enumeration
The text was updated successfully, but these errors were encountered: