@@ -161,9 +161,10 @@ public static UpdateBuilder BitwiseOr(string name, long value)
161
161
/// </summary>
162
162
/// <param name="updates">The UpdateBuilders to combine.</param>
163
163
/// <returns>A combined UpdateBuilder.</returns>
164
- public static UpdateBuilder Combine ( IEnumerable < UpdateBuilder > updates )
164
+ public static UpdateBuilder Combine ( IEnumerable < IMongoUpdate > updates )
165
165
{
166
166
if ( updates == null ) { throw new ArgumentNullException ( "updates" ) ; }
167
+
167
168
var combined = new UpdateBuilder ( ) ;
168
169
foreach ( var update in updates )
169
170
{
@@ -177,9 +178,9 @@ public static UpdateBuilder Combine(IEnumerable<UpdateBuilder> updates)
177
178
/// </summary>
178
179
/// <param name="updates">The UpdateBuilders to combine.</param>
179
180
/// <returns>A combined UpdateBuilder.</returns>
180
- public static UpdateBuilder Combine ( params UpdateBuilder [ ] updates )
181
+ public static UpdateBuilder Combine ( params IMongoUpdate [ ] updates )
181
182
{
182
- return Combine ( ( IEnumerable < UpdateBuilder > ) updates ) ;
183
+ return Combine ( ( IEnumerable < IMongoUpdate > ) updates ) ;
183
184
}
184
185
185
186
/// <summary>
@@ -800,12 +801,15 @@ public UpdateBuilder BitwiseOr(string name, long value)
800
801
/// <summary>
801
802
/// Combines another UpdateBuilder into this one.
802
803
/// </summary>
803
- /// <param name="otherUpdateBuilder ">The UpdateBuilder to combine into this one.</param>
804
+ /// <param name="other ">The IMongoUpdate to combine into this one.</param>
804
805
/// <returns>A combined UpdateBuilder.</returns>
805
- public UpdateBuilder Combine ( UpdateBuilder otherUpdateBuilder )
806
+ public UpdateBuilder Combine ( IMongoUpdate other )
806
807
{
807
- if ( otherUpdateBuilder == null ) { throw new ArgumentNullException ( "otherUpdateBuilder" ) ; }
808
- foreach ( var otherOperation in otherUpdateBuilder . Document )
808
+ if ( other == null ) { throw new ArgumentNullException ( "other" ) ; }
809
+
810
+ var otherUpdate = other . ToBsonDocument ( ) ;
811
+
812
+ foreach ( var otherOperation in otherUpdate )
809
813
{
810
814
var otherOperationName = otherOperation . Name ;
811
815
var otherTargets = otherOperation . Value . AsBsonDocument ;
@@ -1604,7 +1608,7 @@ public static UpdateBuilder<TDocument> BitwiseOr(Expression<Func<TDocument, long
1604
1608
/// <returns>
1605
1609
/// A combined UpdateBuilder.
1606
1610
/// </returns>
1607
- public static UpdateBuilder < TDocument > Combine ( IEnumerable < UpdateBuilder < TDocument > > updates )
1611
+ public static UpdateBuilder < TDocument > Combine ( IEnumerable < IMongoUpdate > updates )
1608
1612
{
1609
1613
if ( updates == null ) { throw new ArgumentNullException ( "updates" ) ; }
1610
1614
var combined = new UpdateBuilder < TDocument > ( ) ;
@@ -1618,13 +1622,13 @@ public static UpdateBuilder<TDocument> Combine(IEnumerable<UpdateBuilder<TDocume
1618
1622
/// <summary>
1619
1623
/// Combines several UpdateBuilders into a single UpdateBuilder.
1620
1624
/// </summary>
1621
- /// <param name="updates">The UpdateBuilders to combine.</param>
1625
+ /// <param name="updates">The updates to combine.</param>
1622
1626
/// <returns>
1623
1627
/// A combined UpdateBuilder.
1624
1628
/// </returns>
1625
- public static UpdateBuilder < TDocument > Combine ( params UpdateBuilder < TDocument > [ ] updates )
1629
+ public static UpdateBuilder < TDocument > Combine ( params IMongoUpdate [ ] updates )
1626
1630
{
1627
- return Combine ( ( IEnumerable < UpdateBuilder < TDocument > > ) updates ) ;
1631
+ return Combine ( ( IEnumerable < IMongoUpdate > ) updates ) ;
1628
1632
}
1629
1633
1630
1634
/// <summary>
@@ -2013,11 +2017,11 @@ public UpdateBuilder<TDocument> BitwiseOr(Expression<Func<TDocument, long>> memb
2013
2017
/// <summary>
2014
2018
/// Combines another UpdateBuilder into this one.
2015
2019
/// </summary>
2016
- /// <param name="otherUpdateBuilder ">The UpdateBuilder to combine into this one.</param>
2020
+ /// <param name="other ">The UpdateBuilder to combine into this one.</param>
2017
2021
/// <returns>A combined UpdateBuilder.</returns>
2018
- public UpdateBuilder < TDocument > Combine ( UpdateBuilder < TDocument > otherUpdateBuilder )
2022
+ public UpdateBuilder < TDocument > Combine ( IMongoUpdate other )
2019
2023
{
2020
- _updateBuilder = _updateBuilder . Combine ( otherUpdateBuilder . _updateBuilder ) ;
2024
+ _updateBuilder = _updateBuilder . Combine ( other ) ;
2021
2025
return this ;
2022
2026
}
2023
2027
0 commit comments