|
Suspending work on this until we decide what we want to do about backward compatibility issues.
The natural way to implement this change is to add new overloads of ReplaceOne that take a ReplaceOptions value (the existing overloads take an UpdateOptions).
The problems identified are:
collection.ReplaceOne(filter, replacement); // is potentially ambiguous
|
This call would be ambiguous if both overloads declare the options parameter as optional. We can fix this by changing the existing overload to take a mandatory UpdateOptions and only have the options be optional in the new overload that takes a ReplaceOptions.
collection.ReplaceOne(filter, replacement, null); // is ambiguous
|
This call is ambiguous because the compiler can't decide whether the null argument is a null UpdateOptions or a null ReplaceOptions.
|