Click or drag to resize

BuilderWithSessionName Method

ISession objects created through the ICluster built from this builder will have SessionName set to the value provided in this method. The first session created by this cluster instance will have its name set exactly as it is provided in this method. Any session created by the ICluster built from this builder after the first one will have its name set as a concatenation of the provided value plus a counter.
var cluster = Cluster.Builder().WithSessionName("main-session").Build();
var session = cluster.Connect(); // session.SessionName == "main-session"
var session1 = cluster.Connect(); // session1.SessionName == "main-session1"
var session2 = cluster.Connect(); // session2.SessionName == "main-session2"
If this setting is not set, the default session names will be "s0", "s1", "s2", etc.
var cluster = Cluster.Builder().Build();
var session = cluster.Connect(); // session.SessionName == "s0"
var session1 = cluster.Connect(); // session1.SessionName == "s1"
var session2 = cluster.Connect(); // session2.SessionName == "s2"

Namespace:  Dse
Assembly:  Dse (in Dse.dll) Version: 2.9.0
Syntax
C#
public Builder WithSessionName(
	string sessionName
)

Parameters

sessionName
Type: SystemString

Return Value

Type: Builder
See Also