Skip to content

Commit

Permalink
Clean: Modernize style in ValueUtilsSmi (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wraith2 authored Feb 25, 2022
1 parent bddbeda commit a359a18
Show file tree
Hide file tree
Showing 9 changed files with 534 additions and 796 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9809,7 +9809,6 @@ private void WriteSmiParameter(SqlParameter param, int paramIndex, bool sendDefa
value,
typeCode,
param.Offset,
0 < param.Size ? param.Size : -1,
peekAhead);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7608,7 +7608,7 @@ private SmiRequestExecutor SetUpSmiRequest(SqlInternalConnectionSmi innerConnect

if (innerConnection.Is2008OrNewer)
{
ValueUtilsSmi.SetCompatibleValueV200(EventSink, requestExecutor, index, requestMetaData[index], value, typeCode, param.Offset, param.Size, peekAheadValues[index]);
ValueUtilsSmi.SetCompatibleValueV200(EventSink, requestExecutor, index, requestMetaData[index], value, typeCode, param.Offset, peekAheadValues[index]);
}
else
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10754,7 +10754,6 @@ private void WriteSmiParameter(SqlParameter param, int paramIndex, bool sendDefa
value,
typeCode,
param.Offset,
0 < param.Size ? param.Size : -1,
peekAhead);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public virtual int GetSqlValues(object[] values)
public virtual void SetDBNull(int ordinal)
{
ThrowIfInvalidOrdinal(ordinal);
ValueUtilsSmi.SetDBNull(_eventSink, _recordBuffer, ordinal, true);
ValueUtilsSmi.SetDBNull(_eventSink, _recordBuffer, ordinal);
}

/// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient.Server/SqlDataRecord.xml' path='docs/members[@name="SqlDataRecord"]/SetGuid/*' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ private Type GetFieldTypeFrameworkSpecific(int ordinal)
=> MetaType.GetMetaTypeFromSqlDbType(GetSqlMetaData(ordinal).SqlDbType, false).ClassType;

private object GetValueFrameworkSpecific(int ordinal)
=> ValueUtilsSmi.GetValue200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal));
=> ValueUtilsSmi.GetValue200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), null);
private object GetSqlValueFrameworkSpecific(int ordinal)
=> ValueUtilsSmi.GetSqlValue200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal));
=> ValueUtilsSmi.GetSqlValue200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), null);

private SqlBytes GetSqlBytesFrameworkSpecific(int ordinal)
=> ValueUtilsSmi.GetSqlBytes(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal));
=> ValueUtilsSmi.GetSqlBytes(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), null);

private SqlXml GetSqlXmlFrameworkSpecific(int ordinal)
=> ValueUtilsSmi.GetSqlXml(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal));
=> ValueUtilsSmi.GetSqlXml(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), null);

private SqlChars GetSqlCharsFrameworkSpecific(int ordinal)
=> ValueUtilsSmi.GetSqlChars(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal));
=> ValueUtilsSmi.GetSqlChars(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), null);
private int SetValuesFrameworkSpecific(params object[] values)
{
if (values == null)
Expand Down Expand Up @@ -60,7 +60,7 @@ private int SetValuesFrameworkSpecific(params object[] values)
// the validation loop and here, or if an invalid UDT was sent).
for (int i = 0; i < copyLength; i++)
{
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, i, GetSmiMetaData(i), values[i], typeCodes[i], offset: 0, length: 0, peekAhead: null);
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, i, GetSmiMetaData(i), values[i], typeCodes[i], offset: 0, peekAhead: null);
}

return copyLength;
Expand All @@ -80,7 +80,7 @@ private void SetValueFrameworkSpecific(int ordinal, object value)
throw ADP.InvalidCast();
}

ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), value, typeCode, offset: 0, length: 0, peekAhead: null);
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), value, typeCode, offset: 0, peekAhead: null);
}

private void SetTimeSpanFrameworkSpecific(int ordinal, TimeSpan value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private int SetValuesFrameworkSpecific(params object[] values)
{
if (SmiVersion >= SmiContextFactory.Sql2008Version)
{
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, i, GetSmiMetaData(i), values[i], typeCodes[i], offset: 0, length: 0, peekAhead: null);
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, i, GetSmiMetaData(i), values[i], typeCodes[i], offset: 0, peekAhead: null);
}
else
{
Expand Down Expand Up @@ -119,7 +119,7 @@ private void SetValueFrameworkSpecific(int ordinal, object value)

if (SmiVersion >= SmiContextFactory.Sql2008Version)
{
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), value, typeCode, offset: 0, length: 0, peekAhead: null);
ValueUtilsSmi.SetCompatibleValueV200(_eventSink, _recordBuffer, ordinal, GetSmiMetaData(ordinal), value, typeCode, offset: 0, peekAhead: null);
}
else
{
Expand Down
Loading

0 comments on commit a359a18

Please sign in to comment.