Class ConnectionId
- Namespace
- MongoDB.Driver.Core.Connections
- Assembly
- MongoDB.Driver.Core.dll
Represents a connection identifier.
[Serializable]
public sealed class ConnectionId : IEquatable<ConnectionId>
- Inheritance
-
ConnectionId
- Implements
- Inherited Members
Constructors
ConnectionId(ServerId)
Initializes a new instance of the ConnectionId class.
public ConnectionId(ServerId serverId)
Parameters
serverId
ServerIdThe server identifier.
ConnectionId(ServerId, long)
Initializes a new instance of the ConnectionId class.
public ConnectionId(ServerId serverId, long localValue)
Parameters
Properties
LocalValue
Gets the local value.
[Obsolete("Use LongLocalValue instead.")]
public int LocalValue { get; }
Property Value
- int
The local value.
LongLocalValue
Gets the local value.
public long LongLocalValue { get; }
Property Value
- long
The local value.
LongServerValue
Gets the server value.
public long? LongServerValue { get; }
Property Value
- long?
The server value.
ServerId
Gets the server identifier.
public ServerId ServerId { get; }
Property Value
- ServerId
The server identifier.
ServerValue
Gets the server value.
[Obsolete("Use LongServerValue instead.")]
public int? ServerValue { get; }
Property Value
- int?
The server value.
Methods
Equals(ConnectionId)
public bool Equals(ConnectionId other)
Parameters
other
ConnectionId
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
StructurallyEquals(ConnectionId)
Compares all fields of two ConnectionId instances (Equals ignores the ServerValue).
public bool StructurallyEquals(ConnectionId other)
Parameters
other
ConnectionIdThe other ConnectionId.
Returns
- bool
True if both instances are equal.
ToString()
public override string ToString()
Returns
WithServerValue(long)
Returns a new instance of ConnectionId with a new server value.
public ConnectionId WithServerValue(long serverValue)
Parameters
serverValue
longThe server value.
Returns
- ConnectionId
A ConnectionId.