Exemplo n.º 1
0
        public static ConversionOperatorDeclarationSyntax ToStatementBody(ConversionOperatorDeclarationSyntax method)
        {
            var body = method.ExpressionBody.Expression.WithLeadingTrivia(SyntaxFactory.Space);

            return(method.WithBody(SyntaxFactory.Block((StatementSyntax)SyntaxFactory.ReturnStatement(body)))
                   .WithExpressionBody(null)
                   .WithSemicolonToken(SyntaxFactory.MissingToken(SyntaxKind.SemicolonToken))
                   .WithTrailingTrivia(method.GetTrailingTrivia()));
        }