-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
IDataRecord.GetBytes/GetChars should be annotated to allow a null buffer #44886
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
cc: @roji |
Tagging subscribers to this area: @roji, @ajcvickers Issue DetailsThe The documentation states:
Source: https://docs.microsoft.com/en-us/dotnet/api/system.data.idatarecord.getchars?view=net-5.0#remarks In SqlClient the implementation does indeed conform to the documentation: https://github.com/dotnet/SqlClient/blob/f0572f3e9990b391d6102911fe12223e748e117b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs#L1663
|
Yeah, this is an incorrect annotation. I've submitted #44938 to fix this; technically this is a breaking change in case someone has implemented IDataRecord directly (as opposed to via DbDataReader, which is correctly annotated). Listed this in dotnet/docs#21202 for documentation. |
The
buffer
parameter ofGetBytes
/GetChars
should be annotated to allow null values. Currently in .NET 5.0.0 they are annotated to not allow null values (see #38810).The documentation states:
Source: https://docs.microsoft.com/en-us/dotnet/api/system.data.idatarecord.getchars?view=net-5.0#remarks
In SqlClient the implementation does indeed conform to the documentation: https://github.com/dotnet/SqlClient/blob/f0572f3e9990b391d6102911fe12223e748e117b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs#L1663
The text was updated successfully, but these errors were encountered: