-
Type: Task
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Dotnet Drivers
Within MongoCollectionImpl:BulkWriteAsync, there are 4 (in error case: 5) enumerations of the requests parameter, but the parameter is listed as IEnumerable. Since the requests are often build in client code by selecting over some input and mapping into UpdateModels, and the resulted linq tree just passed to BulkWrite, this will cause recreation of the UpdateModels over and over again, potentially causing side effects (we had issues in our code because of this).
The code should do a conditinal if( requests is not ICollection) requests = requests.ToList() to prevent this from happening.
- duplicates
-
CSHARP-2385 Support lazy enumeration in BulkWrite
- Closed
-
CSHARP-1378 Make BulkWrite enumerate requests argument only once
- Closed