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

Correct nullability annotation for IDataRecord #44938

Merged
merged 2 commits into from
Nov 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,9 +1259,9 @@ public partial interface IDataRecord
object this[string name] { get; }
bool GetBoolean(int i);
byte GetByte(int i);
long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length);
long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length);
char GetChar(int i);
long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length);
long GetChars(int i, long fieldoffset, char[]? buffer, int bufferoffset, int length);
System.Data.IDataReader GetData(int i);
string GetDataTypeName(int i);
System.DateTime GetDateTime(int i);
Expand Down Expand Up @@ -2202,9 +2202,9 @@ protected DbDataRecord() { }
public abstract object this[string name] { get; }
public abstract bool GetBoolean(int i);
public abstract byte GetByte(int i);
public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
public abstract long GetBytes(int i, long dataIndex, byte[]? buffer, int bufferIndex, int length);
public abstract char GetChar(int i);
public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
public abstract long GetChars(int i, long dataIndex, char[]? buffer, int bufferIndex, int length);
public System.Data.IDataReader GetData(int i) { throw null; }
public abstract string GetDataTypeName(int i);
public abstract System.DateTime GetDateTime(int i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public override byte GetByte(int i)
return ((byte)_values[i]);
}

public override long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length)
public override long GetBytes(int i, long dataIndex, byte[]? buffer, int bufferIndex, int length)
{
int cbytes = 0;
int ndataIndex;
Expand Down Expand Up @@ -170,7 +170,7 @@ public override long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIn

public override char GetChar(int i) => ((string)_values[i])[0];

public override long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length)
public override long GetChars(int i, long dataIndex, char[]? buffer, int bufferIndex, int length)
{
// if the object doesn't contain a char[] then the user will get an exception
string s = (string)_values[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ protected DbDataRecord() : base() { }

public abstract byte GetByte(int i);

public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
public abstract long GetBytes(int i, long dataIndex, byte[]? buffer, int bufferIndex, int length);

public abstract char GetChar(int i);

public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
public abstract long GetChars(int i, long dataIndex, char[]? buffer, int bufferIndex, int length);

public IDataReader GetData(int i) => GetDbDataReader(i);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public interface IDataRecord
int GetOrdinal(string name);
bool GetBoolean(int i);
byte GetByte(int i);
long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length);
long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length);
char GetChar(int i);
long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length);
long GetChars(int i, long fieldoffset, char[]? buffer, int bufferoffset, int length);
Guid GetGuid(int i);
short GetInt16(int i);
int GetInt32(int i);
Expand Down