/// <summary> /// Creates a new object that is like this one, but using the supplied children. If all of the children are the same, it will return this object. /// </summary> /// <param name="getEnumerator">The <see cref="GetEnumerator"/> property of the result.</param> /// <param name="moveNext">The <see cref="MoveNext"/> property of the result.</param> /// <param name="currentConversion">The <see cref="CurrentConversion"/> property of the result.</param> /// <param name="disposeAwaitInfo">The <see cref="DisposeAwaitInfo"/> property of the result.</param> /// <param name="patternDispose">The <see cref="PatternDispose"/> property of the result.</param> /// <returns>This object if no children changed, or an object with the updated children.</returns> public EnumeratorInfo Update(LambdaExpression getEnumerator, LambdaExpression moveNext, LambdaExpression currentConversion, AwaitInfo disposeAwaitInfo, LambdaExpression patternDispose) { if (getEnumerator == GetEnumerator && moveNext == MoveNext && currentConversion == CurrentConversion && disposeAwaitInfo == DisposeAwaitInfo && patternDispose == PatternDispose) { return(this); } return(CSharpExpression.EnumeratorInfo(IsAsync, CollectionType, getEnumerator, moveNext, Current, currentConversion, ElementType, NeedsDisposal, DisposeAwaitInfo, patternDispose)); }