It's an error to call BulkWrite with an empty list of requests, and BulkWrite will throw an exception if it is called with an empty list. You can easily replicate it using following code:
var requests = Enumerable.Empty<WriteModel<C>>();
collection.BulkWrite(requests);
It will throw following run time exception:
System.ArgumentException: Must contain at least 1 request.
Parameter name: requests
at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken) in C:\work\rstam\mongo-csharp-driver\src\MongoDB.Driver\MongoCollectionImpl.cs:line 151
at TestCSharp1956.Program.Main(String[] args) in C:\projects\TestCSharp1956\TestCSharp1956\Program.cs:line 27
Posted On:
14-Nov-2020 23:22