@@ -26,29 +26,29 @@ internal abstract class FilteredMongoCollectionBase<TDocument> : MongoCollection
26
26
{
27
27
// private fields
28
28
private readonly FilterDefinition < TDocument > _filter ;
29
- private readonly IMongoCollection < TDocument > _unfilteredCollection ;
29
+ private readonly IMongoCollection < TDocument > _wrappedCollection ;
30
30
31
31
// constructors
32
- public FilteredMongoCollectionBase ( IMongoCollection < TDocument > unfilteredCollection , FilterDefinition < TDocument > filter )
32
+ public FilteredMongoCollectionBase ( IMongoCollection < TDocument > wrappedCollection , FilterDefinition < TDocument > filter )
33
33
{
34
- _unfilteredCollection = unfilteredCollection ;
34
+ _wrappedCollection = wrappedCollection ;
35
35
_filter = filter ;
36
36
}
37
37
38
38
// public properties
39
39
public override CollectionNamespace CollectionNamespace
40
40
{
41
- get { return _unfilteredCollection . CollectionNamespace ; }
41
+ get { return _wrappedCollection . CollectionNamespace ; }
42
42
}
43
43
44
44
public override IMongoDatabase Database
45
45
{
46
- get { return _unfilteredCollection . Database ; }
46
+ get { return _wrappedCollection . Database ; }
47
47
}
48
48
49
49
public override IBsonSerializer < TDocument > DocumentSerializer
50
50
{
51
- get { return _unfilteredCollection . DocumentSerializer ; }
51
+ get { return _wrappedCollection . DocumentSerializer ; }
52
52
}
53
53
54
54
public FilterDefinition < TDocument > Filter
@@ -58,18 +58,18 @@ public FilterDefinition<TDocument> Filter
58
58
59
59
public override IMongoIndexManager < TDocument > Indexes
60
60
{
61
- get { return _unfilteredCollection . Indexes ; }
61
+ get { return _wrappedCollection . Indexes ; }
62
62
}
63
63
64
64
public override MongoCollectionSettings Settings
65
65
{
66
- get { return _unfilteredCollection . Settings ; }
66
+ get { return _wrappedCollection . Settings ; }
67
67
}
68
68
69
69
// protected properties
70
- protected IMongoCollection < TDocument > UnfilteredCollection
70
+ protected IMongoCollection < TDocument > WrappedCollection
71
71
{
72
- get { return _unfilteredCollection ; }
72
+ get { return _wrappedCollection ; }
73
73
}
74
74
75
75
// public methods
@@ -92,49 +92,49 @@ protected IMongoCollection<TDocument> UnfilteredCollection
92
92
93
93
var optimizedPipeline = new OptimizingPipelineDefinition < TDocument , TResult > ( combinedPipeline ) ;
94
94
95
- return _unfilteredCollection . AggregateAsync ( optimizedPipeline , options , cancellationToken ) ;
95
+ return _wrappedCollection . AggregateAsync ( optimizedPipeline , options , cancellationToken ) ;
96
96
}
97
97
98
98
public override Task < BulkWriteResult < TDocument > > BulkWriteAsync ( IEnumerable < WriteModel < TDocument > > requests , BulkWriteOptions options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
99
99
{
100
- return _unfilteredCollection . BulkWriteAsync ( CombineModelFilters ( requests ) , options , cancellationToken ) ;
100
+ return _wrappedCollection . BulkWriteAsync ( CombineModelFilters ( requests ) , options , cancellationToken ) ;
101
101
}
102
102
103
103
public override Task < long > CountAsync ( FilterDefinition < TDocument > filter , CountOptions options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
104
104
{
105
- return _unfilteredCollection . CountAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
105
+ return _wrappedCollection . CountAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
106
106
}
107
107
108
108
public override Task < IAsyncCursor < TField > > DistinctAsync < TField > ( FieldDefinition < TDocument , TField > field , FilterDefinition < TDocument > filter , DistinctOptions options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
109
109
{
110
- return _unfilteredCollection . DistinctAsync ( field , CombineFilters ( filter ) , options , cancellationToken ) ;
110
+ return _wrappedCollection . DistinctAsync ( field , CombineFilters ( filter ) , options , cancellationToken ) ;
111
111
}
112
112
113
113
public override Task < IAsyncCursor < TProjection > > FindAsync < TProjection > ( FilterDefinition < TDocument > filter , FindOptions < TDocument , TProjection > options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
114
114
{
115
- return _unfilteredCollection . FindAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
115
+ return _wrappedCollection . FindAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
116
116
}
117
117
118
118
public override Task < TProjection > FindOneAndDeleteAsync < TProjection > ( FilterDefinition < TDocument > filter , FindOneAndDeleteOptions < TDocument , TProjection > options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
119
119
{
120
- return _unfilteredCollection . FindOneAndDeleteAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
120
+ return _wrappedCollection . FindOneAndDeleteAsync ( CombineFilters ( filter ) , options , cancellationToken ) ;
121
121
}
122
122
123
123
public override Task < TProjection > FindOneAndReplaceAsync < TProjection > ( FilterDefinition < TDocument > filter , TDocument replacement , FindOneAndReplaceOptions < TDocument , TProjection > options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
124
124
{
125
- return _unfilteredCollection . FindOneAndReplaceAsync ( CombineFilters ( filter ) , replacement , options , cancellationToken ) ;
125
+ return _wrappedCollection . FindOneAndReplaceAsync ( CombineFilters ( filter ) , replacement , options , cancellationToken ) ;
126
126
}
127
127
128
128
public override Task < TProjection > FindOneAndUpdateAsync < TProjection > ( FilterDefinition < TDocument > filter , UpdateDefinition < TDocument > update , FindOneAndUpdateOptions < TDocument , TProjection > options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
129
129
{
130
- return _unfilteredCollection . FindOneAndUpdateAsync ( CombineFilters ( filter ) , update , options , cancellationToken ) ;
130
+ return _wrappedCollection . FindOneAndUpdateAsync ( CombineFilters ( filter ) , update , options , cancellationToken ) ;
131
131
}
132
132
133
133
public override Task < IAsyncCursor < TResult > > MapReduceAsync < TResult > ( BsonJavaScript map , BsonJavaScript reduce , MapReduceOptions < TDocument , TResult > options = null , CancellationToken cancellationToken = default ( CancellationToken ) )
134
134
{
135
135
options = options ?? new MapReduceOptions < TDocument , TResult > ( ) ;
136
136
options . Filter = CombineFilters ( options . Filter ) ;
137
- return _unfilteredCollection . MapReduceAsync ( map , reduce , options , cancellationToken ) ;
137
+ return _wrappedCollection . MapReduceAsync ( map , reduce , options , cancellationToken ) ;
138
138
}
139
139
140
140
// private methods
0 commit comments