Skip to content

Commit f89f06a

Browse files
committed
addressing comments
1 parent 33aa5e5 commit f89f06a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/client-api/configuration/load-balance/_load-balance-behavior-csharp.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private string GetDefaultContext(string dbName)
9999
\{
100100
// Get the string set by the web application elsewhere.
101101
var ctx = System.Web.HttpContext.Current;
102-
if (ctx == null || ctx.Items.Contains(ContextKey) == false)
102+
if (ctx == null)
103103
{
104104
// return a safe default
105105
return dbName;
@@ -130,14 +130,13 @@ using (var session = documentStore.OpenSession())
130130
{`// Open a session that will use a UNIQUE context string:
131131
using (var session = documentStore.OpenSession())
132132
\{
133-
// Call SetContext, pass a unique context string for this session.
134-
// In this case, a team identifier, where both employees belong to.
133+
// Call 'SetContext' to assign a dedicated context string for this session.
134+
// For example: "team/9-A", representing the team that the employees loaded in this session belong to.
135135
session.Advanced.SessionInfo.SetContext("team/9-A");
136136
137-
// For all Read & Write requests made in this session,
138-
// node to access is calculated from the unique string & the seed defined on the store
137+
// For all Read & Write requests made in this session, including the following load calls,
138+
// a node to access is calculated from the unique string & the seed defined on the store
139139
var employee1 = session.Load<Employee>("employees/1-A");
140-
141140
var employee2 = session.Load<Employee>("employees/3-A");
142141
\}
143142
`}

0 commit comments

Comments
 (0)