Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@
<Compile Include="Microsoft\Data\Common\DbConnectionOptions.cs" />
<Compile Include="Microsoft\Data\Common\DbConnectionString.cs" />
<Compile Include="Microsoft\Data\Common\GreenMethods.cs" />
<Compile Include="Microsoft\Data\SqlClient\assemblycache.cs" />
<Compile Include="Microsoft\Data\SqlClient\BufferWriterExtensions.cs" />
<Compile Include="Microsoft\Data\SqlClient\Reliability\SqlConfigurableRetryLogicManager.LoadType.cs" />
<Compile Include="Microsoft\Data\SqlClient\Server\SmiConnection.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ internal byte[] GetBytes(object o)

internal byte[] GetBytes(object o, out Format format, out int maxSize)
{
SqlUdtInfo attr = AssemblyCache.GetInfoFromType(o.GetType());
SqlUdtInfo attr = GetInfoFromType(o.GetType());
maxSize = attr.MaxByteSize;
format = attr.SerializationFormat;

Expand All @@ -2743,5 +2743,24 @@ internal byte[] GetBytes(object o, out Format format, out int maxSize)
}
return retval;
}

private SqlUdtInfo GetInfoFromType(Type t)
{
Debug.Assert(t != null, "Type object can't be NULL");
Type orig = t;
do
{
SqlUdtInfo attr = SqlUdtInfo.TryGetFromType(t);
if (attr != null)
{
return attr;
}

t = t.BaseType;
}
while (t != null);

throw SQL.UDTInvalidSqlType(orig.AssemblyQualifiedName);
}
} // SqlConnection
} // Microsoft.Data.SqlClient namespace

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1614,12 +1614,7 @@ internal int GetActualSize()
case SqlDbType.Udt:
if (!IsNull)
{
#if NETFRAMEWORK
//call the static function
coercedSize = AssemblyCache.GetLength(val);
#else
coercedSize = SerializationHelperSql9.SizeInBytes(val);
#endif
}
break;
case SqlDbType.Structured:
Expand Down
Loading