Skip to content

Commit 915ec54

Browse files
committed
Fix
1 parent 62e6486 commit 915ec54

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

source/fundamentals/read-write-configuration.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@ The following example sets the write concern to ``"majority"`` for an instance o
7272
:start-after: start-write-concern-client
7373
:end-before: end-write-concern-client
7474
:language: csharp
75+
:dedent:
7576

7677
The following example sets the write concern to ``"majority"`` for a collection:
7778

7879
.. literalinclude:: /includes/fundamentals/code-examples/ReplicaSetConfigs.cs
7980
:start-after: start-write-concern-collection
8081
:end-before: end-write-concern-collection
8182
:language: csharp
83+
:dedent:
8284

8385
.. note:: Collections and Databases are Immutable
8486

@@ -134,6 +136,7 @@ The following example sets the read concern to ``"majority"`` for an instance of
134136
:start-after: start-read-concern-client
135137
:end-before: end-read-concern-client
136138
:language: csharp
139+
:dedent:
137140

138141
The following example sets the read concern to ``"majority"`` for a
139142
collection:
@@ -142,6 +145,7 @@ collection:
142145
:start-after: start-read-concern-collection
143146
:end-before: end-read-concern-collection
144147
:language: csharp
148+
:dedent:
145149

146150
To learn more about read concern, see :manual:`Read Concern
147151
<reference/read-concern>` in the {+mdb-server+} manual.
@@ -174,21 +178,23 @@ for an instance of ``MongoClient``:
174178
:start-after: start-read-preference-client
175179
:end-before: end-read-preference-client
176180
:language: csharp
181+
:dedent:
177182

178183
The following example sets the read preference to ``"secondary"`` for a collection:
179184

180185
.. literalinclude:: /includes/fundamentals/code-examples/ReplicaSetConfigs.cs
181186
:start-after: start-read-preference-collection
182187
:end-before: end-read-preference-collection
183188
:language: csharp
189+
:dedent:
184190

185191
For more information about read preference, see :manual:`Read Preference
186192
</core/read-preference/>` in the {+mdb-server+} manual.
187193

188194
API Documentation
189195
-----------------
190196

191-
To learn more about any of the methods or types discussed in this
197+
To learn more about any of the types discussed in this
192198
guide, see the following API documentation:
193199

194200
- `MongoClientSettings <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.MongoClientSettings.html>`__

source/includes/fundamentals/code-examples/ReplicaSetConfigs.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public static void Main(string[] args)
1717
{
1818
var database = client.GetDatabase("test");
1919
// start-write-concern-collection
20-
var collection = database.GetCollection<BsonDocument>("<collection name>").WithWriteConcern(WriteConcern.WMajority);
20+
var collection = database.GetCollection<BsonDocument>("<collection name>")
21+
.WithWriteConcern(WriteConcern.WMajority);
2122
// end-write-concern-collection
2223
}
2324

@@ -32,7 +33,8 @@ public static void Main(string[] args)
3233
{
3334
var database = client.GetDatabase("test");
3435
// start-read-concern-collection
35-
var collection = database.GetCollection<BsonDocument>("<collection name>").WithReadConcern(ReadConcern.Majority);
36+
var collection = database.GetCollection<BsonDocument>("<collection name>")
37+
.WithReadConcern(ReadConcern.Majority);
3638
// end-read-concern-collection
3739
}
3840

@@ -47,7 +49,8 @@ public static void Main(string[] args)
4749
{
4850
var database = client.GetDatabase("test");
4951
// start-read-preference-collection
50-
var collection = database.GetCollection<BsonDocument>("<collection name>").WithReadPreference(ReadPreference.Secondary);
52+
var collection = database.GetCollection<BsonDocument>("<collection name>")
53+
.WithReadPreference(ReadPreference.Secondary);
5154
// end-read-preference-collection
5255
}
5356
}

0 commit comments

Comments
 (0)