Skip to content

Commit 715e71c

Browse files
committed
Merge Status, SessionId, SessionHandle properties
1 parent 9933933 commit 715e71c

File tree

4 files changed

+21
-34
lines changed

4 files changed

+21
-34
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.netcore.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,6 @@ internal TdsParserStateObject(TdsParser parser, TdsParserStateObject physicalCon
6363
_lastSuccessfulIOTimer = parser._physicalStateObj._lastSuccessfulIOTimer;
6464
}
6565

66-
////////////////
67-
// Properties //
68-
////////////////
69-
70-
internal abstract uint Status
71-
{
72-
get;
73-
}
74-
75-
internal abstract Guid? SessionId { get; }
76-
77-
internal abstract SessionHandle SessionHandle
78-
{
79-
get;
80-
}
81-
8266
/////////////////////
8367
// General methods //
8468
/////////////////////

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

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Microsoft.Data.SqlClient
2222

2323
internal partial class TdsParserStateObject
2424
{
25-
private SNIHandle _sessionHandle = null; // the SNI handle we're to work on
25+
protected SNIHandle _sessionHandle = null; // the SNI handle we're to work on
2626

2727
// SNI variables // multiple resultsets in one batch.
2828
private SNIPacket _sniPacket = null; // Will have to re-vamp this for MARS
@@ -90,23 +90,6 @@ internal SNIHandle Handle
9090
}
9191
}
9292

93-
internal uint Status
94-
{
95-
get
96-
{
97-
if (_sessionHandle != null)
98-
{
99-
return _sessionHandle.Status;
100-
}
101-
else
102-
{ // SQL BU DT 395431.
103-
return TdsEnums.SNI_UNINITIALIZED;
104-
}
105-
}
106-
}
107-
108-
internal SessionHandle SessionHandle => SessionHandle.FromNativeHandle(Handle);
109-
11093
/////////////////////
11194
// General methods //
11295
/////////////////////

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ internal TdsParserStateObjectNative(TdsParser parser)
1919
{
2020
}
2121

22+
////////////////
23+
// Properties //
24+
////////////////
25+
26+
internal override uint Status => _sessionHandle != null ? _sessionHandle.Status : TdsEnums.SNI_UNINITIALIZED;
27+
28+
internal override SessionHandle SessionHandle => SessionHandle.FromNativeHandle(_sessionHandle);
29+
30+
internal override Guid? SessionId => default;
31+
2232
internal override uint SniGetConnectionId(ref Guid clientConnectionId)
2333
=> SniNativeWrapper.SniGetConnectionId(Handle, ref clientConnectionId);
2434

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,16 @@ internal long TimeoutTime
472472
}
473473
}
474474

475+
////////////////
476+
// Properties //
477+
////////////////
478+
479+
internal abstract uint Status { get; }
480+
481+
internal abstract Guid? SessionId { get; }
482+
483+
internal abstract SessionHandle SessionHandle { get; }
484+
475485
internal abstract uint SniGetConnectionId(ref Guid clientConnectionId);
476486

477487
internal abstract uint DisableSsl();

0 commit comments

Comments
 (0)