Skip to content

Commit 9ef7f78

Browse files
authored
Merge | SqlBuffer (#3368)
* Jam SqlBuffer.netfx components into SqlBuffer class in common project * Class no longer needs to be partial
1 parent a1bfea8 commit 9ef7f78

File tree

3 files changed

+25
-34
lines changed

3 files changed

+25
-34
lines changed

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@
937937
<ItemGroup>
938938
<Compile Include="Microsoft\Data\Common\DbConnectionOptions.cs" />
939939
<Compile Include="Microsoft\Data\Common\DbConnectionString.cs" />
940-
<Compile Include="Microsoft\Data\SqlClient\SqlBuffer.netfx.cs" />
941940
<Compile Include="Microsoft\Data\SqlClient\SqlBulkCopy.cs" />
942941
<Compile Include="Microsoft\Data\SqlClient\SqlClientWrapperSmiStream.cs" />
943942
<Compile Include="Microsoft\Data\SqlClient\SqlClientWrapperSmiStreamChars.cs" />

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlBuffer.netfx.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBuffer.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Microsoft.Data.SqlClient
1313
{
14-
internal sealed partial class SqlBuffer
14+
internal sealed class SqlBuffer
1515
{
1616
internal enum StorageType
1717
{
@@ -1238,6 +1238,17 @@ internal void Clear()
12381238
_object = null;
12391239
}
12401240

1241+
#if NETFRAMEWORK
1242+
internal void SetToDate(DateTime date)
1243+
{
1244+
Debug.Assert(IsEmpty, "setting value a second time?");
1245+
1246+
_type = StorageType.Date;
1247+
_value._int32 = date.Subtract(DateTime.MinValue).Days;
1248+
_isNull = false;
1249+
}
1250+
#endif
1251+
12411252
internal void SetToDateTime(int daypart, int timepart)
12421253
{
12431254
Debug.Assert(IsEmpty, "setting value a second time?");
@@ -1246,6 +1257,19 @@ internal void SetToDateTime(int daypart, int timepart)
12461257
_type = StorageType.DateTime;
12471258
_isNull = false;
12481259
}
1260+
1261+
#if NETFRAMEWORK
1262+
internal void SetToDateTime2(DateTime dateTime, byte scale)
1263+
{
1264+
Debug.Assert(IsEmpty, "setting value a second time?");
1265+
1266+
_type = StorageType.DateTime2;
1267+
_value._dateTime2Info._timeInfo._ticks = dateTime.TimeOfDay.Ticks;
1268+
_value._dateTime2Info._timeInfo._scale = scale;
1269+
_value._dateTime2Info._date = dateTime.Subtract(DateTime.MinValue).Days;
1270+
_isNull = false;
1271+
}
1272+
#endif
12491273

12501274
internal void SetToDecimal(byte precision, byte scale, bool positive, int[] bits)
12511275
{

0 commit comments

Comments
 (0)