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 23
23
using MongoDB . Bson . Serialization . Serializers ;
24
24
using MongoDB . Driver . Core . Bindings ;
25
25
using MongoDB . Driver . Core . Clusters ;
26
+ using MongoDB . Driver . Core . Clusters . ServerSelectors ;
26
27
using MongoDB . Driver . Core . Configuration ;
27
28
using MongoDB . Driver . Core . Misc ;
28
29
using MongoDB . Driver . Core . Operations ;
@@ -66,9 +67,8 @@ public static SemanticVersion ServerVersion
66
67
{
67
68
get
68
69
{
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 ;
72
72
}
73
73
}
74
74
You can’t perform that action at this time.
0 commit comments