Skip to content
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

A small change that makes it possible to pass ObjectReader as SqlDbType.Structured parameter to a stored procedure call #97

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Gagarin23
Copy link

A small change that makes it possible to pass ObjectReader as SqlDbType.Structured parameter to a stored procedure call.
This previously threw an NRF exception in the Microsoft.Data.SqlClient.GetActualFieldsAndProperties method when it tried to access a property on a non-existent column "IsKey".

…pe.Structured parameter to a stored procedure call
@Gagarin23
Copy link
Author

In this place
image

/// <param name="members">The members that should be exposed to the reader</param>
public ObjectReader(Type type, IEnumerable source, params string[] members)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hard break; we can't do that; whatever API changes must be binary compatible; I'm less concerned about build compatible, but that would be nice too.

Adding IsKey itself: fine

Copy link
Author

@Gagarin23 Gagarin23 Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD Key property can be selected via expression
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I create another constructor for backwards compatibility
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants