private MethodDeclarationSyntax AddMethodBody(MethodDeclarationSyntax containingMethod, MetaField field, Func <ExpressionSyntax, InvocationExpressionSyntax> mutatingInvocationFactory)
            {
                var returnExpression = field.IsLocallyDefined
                    ? (ExpressionSyntax)SyntaxFactory.InvocationExpression( // this.With(field: this.field.SomeOperation(someArgs))
                    Syntax.ThisDot(WithMethodName),
                    SyntaxFactory.ArgumentList(SyntaxFactory.SingletonSeparatedList(
                                                   SyntaxFactory.Argument(
                                                       SyntaxFactory.NameColon(field.Name),
                                                       NoneToken,
                                                       mutatingInvocationFactory(Syntax.ThisDot(field.NameAsField))))))
                    : SyntaxFactory.CastExpression( // (TemplateType)base.SameMethod(sameArgs)
                    GetFullyQualifiedSymbolName(this.generator.applyToSymbol),
                    SyntaxFactory.InvocationExpression(
                        Syntax.BaseDot(SyntaxFactory.IdentifierName(containingMethod.Identifier)),
                        SyntaxFactory.ArgumentList(
                            Syntax.JoinSyntaxNodes(
                                SyntaxKind.CommaToken,
                                containingMethod.ParameterList.Parameters.Select(p => SyntaxFactory.Argument(SyntaxFactory.IdentifierName(p.Identifier)))))));

                return(containingMethod.WithBody(SyntaxFactory.Block(
                                                     SyntaxFactory.ReturnStatement(returnExpression))));
            }