Skip to content

Commit 756f9fa

Browse files
author
rstam
committed
CSHARP-797: Changed representation of empty Requests to Enumerable.Empty<WriteRequest>.
1 parent ead7f11 commit 756f9fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MongoDB.Driver/Operations/BulkWriteArgs.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
using System;
1717
using System.Collections.Generic;
18+
using System.Linq;
1819
namespace MongoDB.Driver
1920
{
2021
/// <summary>
@@ -28,7 +29,7 @@ public class BulkWriteArgs
2829
private bool? _isOrdered;
2930
private int? _maxBatchCount;
3031
private int? _maxBatchLength;
31-
private IEnumerable<WriteRequest> _requests = new List<WriteRequest>();
32+
private IEnumerable<WriteRequest> _requests = Enumerable.Empty<WriteRequest>();
3233
private WriteConcern _writeConcern;
3334

3435
// public properties
@@ -95,7 +96,7 @@ public int? MaxBatchLength
9596
public IEnumerable<WriteRequest> Requests
9697
{
9798
get { return _requests; }
98-
set { _requests = value ?? new List<WriteRequest>(); }
99+
set { _requests = value ?? Enumerable.Empty<WriteRequest>(); }
99100
}
100101

101102
/// <summary>

0 commit comments

Comments
 (0)