Table of Contents

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 ServerId

The server identifier.

ConnectionId(ServerId, long)

Initializes a new instance of the ConnectionId class.

public ConnectionId(ServerId serverId, long localValue)

Parameters

serverId ServerId

The server identifier.

localValue long

The local value.

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

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

StructurallyEquals(ConnectionId)

Compares all fields of two ConnectionId instances (Equals ignores the ServerValue).

public bool StructurallyEquals(ConnectionId other)

Parameters

other ConnectionId

The other ConnectionId.

Returns

bool

True if both instances are equal.

ToString()

public override string ToString()

Returns

string

WithServerValue(long)

Returns a new instance of ConnectionId with a new server value.

public ConnectionId WithServerValue(long serverValue)

Parameters

serverValue long

The server value.

Returns

ConnectionId

A ConnectionId.