File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/MongoDB.Driver.Core.TestHelpers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2323using MongoDB . Bson . Serialization . Serializers ;
2424using MongoDB . Driver . Core . Bindings ;
2525using MongoDB . Driver . Core . Clusters ;
26+ using MongoDB . Driver . Core . Clusters . ServerSelectors ;
2627using MongoDB . Driver . Core . Configuration ;
2728using MongoDB . Driver . Core . Misc ;
2829using MongoDB . Driver . Core . Operations ;
@@ -66,9 +67,8 @@ public static SemanticVersion ServerVersion
6667 {
6768 get
6869 {
69- var writableServerDescription = __cluster . Value . Description . Servers . FirstOrDefault (
70- description => description . Type . IsWritable ( ) ) ;
71- return writableServerDescription . Version ;
70+ var server = __cluster . Value . SelectServerAsync ( WritableServerSelector . Instance , CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) ;
71+ return server . Description . Version ;
7272 }
7373 }
7474
You can’t perform that action at this time.
0 commit comments