@@ -86,6 +86,7 @@ public sealed class ConnectionString
86
86
private ReadPreferenceMode ? _readPreference ;
87
87
private IReadOnlyList < TagSet > _readPreferenceTags ;
88
88
private string _replicaSet ;
89
+ private bool ? _retryWrites ;
89
90
private ConnectionStringScheme _scheme ;
90
91
private TimeSpan ? _serverSelectionTimeout ;
91
92
private TimeSpan ? _socketTimeout ;
@@ -327,6 +328,14 @@ public IReadOnlyList<TagSet> ReadPreferenceTags
327
328
}
328
329
329
330
/// <summary>
331
+ /// Gets a value indicating whether or not to retry writes.
332
+ /// </summary>
333
+ public bool ? RetryWrites
334
+ {
335
+ get { return _retryWrites ; }
336
+ }
337
+
338
+ /// <summary>
330
339
/// Gets the scheme.
331
340
/// </summary>
332
341
public ConnectionStringScheme Scheme
@@ -464,6 +473,7 @@ public ConnectionString Resolve()
464
473
/// Resolves a connection string. If the connection string indicates more information is available
465
474
/// in the DNS system, it will acquire that information as well.
466
475
/// </summary>
476
+ /// <param name="cancellationToken">The cancellation token.</param>
467
477
/// <returns>A resolved ConnectionString.</returns>
468
478
public async Task < ConnectionString > ResolveAsync ( CancellationToken cancellationToken = default ( CancellationToken ) )
469
479
{
@@ -764,6 +774,9 @@ private void ParseOption(string name, string value)
764
774
case "replicaset" :
765
775
_replicaSet = value ;
766
776
break ;
777
+ case "retrywrites" :
778
+ _retryWrites = ParseBoolean ( name , value ) ;
779
+ break ;
767
780
case "safe" :
768
781
var safe = ParseBoolean ( name , value ) ;
769
782
if ( _w == null )
0 commit comments