Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ private int RowNumber
switch (_rowSourceType)
{
case ValueSourceType.RowArray:
rowNo = ((DataTable)_dataTableSource).Rows.IndexOf(_rowEnumerator.Current as DataRow);
rowNo = ((DataTable)_dataTableSource).Rows.IndexOf((DataRow)_rowEnumerator.Current);
break;
case ValueSourceType.DataTable:
rowNo = ((DataTable)_rowSource).Rows.IndexOf(_rowEnumerator.Current as DataRow);
rowNo = ((DataTable)_rowSource).Rows.IndexOf((DataRow)_rowEnumerator.Current);
break;
case ValueSourceType.DbDataReader:
case ValueSourceType.IDataReader:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3103,7 +3103,7 @@ private T GetFieldValueFromSqlBufferInternal<T>(SqlBuffer data, _SqlMetaData met
{
throw SQL.JsonDocumentNotSupportedOnColumnType(metaData.column);
}
JsonDocument document = JsonDocument.Parse(data.Value as string);
JsonDocument document = JsonDocument.Parse(data.String);
return (T)(object)document;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ private static void GetSerializedObject(SqlClientObjRef objRef, DataContractSeri
private static SqlDependencyProcessDispatcher GetDeserializedObject(DataContractSerializer serializer, MemoryStream stream)
{
object refResult = serializer.ReadObject(stream);
var result = RemotingServices.Unmarshal((refResult as SqlClientObjRef).GetObjRef());
var result = RemotingServices.Unmarshal(((SqlClientObjRef)refResult).GetObjRef());
return result as SqlDependencyProcessDispatcher;
}
#endif // NETFRAMEWORK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2390,11 +2390,11 @@ internal static object CoerceValue(object value, MetaType destinationType, out b
{
try
{
value = (new SqlVector<float>(JsonSerializer.Deserialize<float[]>(value as string)) as ISqlVector).VectorPayload;
value = ((ISqlVector)new SqlVector<float>(JsonSerializer.Deserialize<float[]>((string)value))).VectorPayload;
}
catch (Exception ex) when (ex is ArgumentNullException || ex is JsonException)
{
throw ADP.InvalidJsonStringForVector(value as string, ex);
throw ADP.InvalidJsonStringForVector((string)value, ex);
}
}
else if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public void InvalidCombinationOfAccessToken(string description, object[] Params)
{
SecureString password = new SecureString();
password.MakeReadOnly();
_credential = new SqlCredential(Params[0] as string, password);
_credential = new SqlCredential((string)Params[0], password);
}
else
{
_builder[Params[0] as string] = Params[1];
_builder[(string)Params[0]] = Params[1];
}
InvalidCombinationCheck(_credential);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PoolBlockPeriodTest
public void TestAzureBlockingPeriod(string description, object[] Params)
{
string _ = description; // Using C# Discards as workaround to the XUnit warning.
string serverName = Params[0] as string;
string serverName = (string)Params[0];
PoolBlockingPeriod? policy = null;
if (Params.Length > 1)
{
Expand All @@ -60,7 +60,7 @@ public void TestAzureBlockingPeriod(string description, object[] Params)
public void TestNonAzureBlockingPeriod(string description, object[] Params)
{
string _ = description; // Using C# Discards as workaround to the XUnit warning.
string serverName = Params[0] as string;
string serverName = (string)Params[0];
PoolBlockingPeriod? policy = null;

if (Params.Length > 1)
Expand Down
Loading