Final Exam: Question Three


Suppose an instance of MongoClient is created with the following settings:

var client = new MongoClient("mongodb+srv://");

MongoClientSettings settings = new MongoClientSettings()
    ConnectTimeout = TimeSpan.FromMilliseconds(50),
    RetryWrites = true

client.Settings = settings;

There is an error in the example code above. It will cause a compilation error because you cannot assign settings to the client.Settings. It’s a read-only property.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.