Skip to main content

SyntaxExtensions.BodyOrExpressionBody Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
BodyOrExpressionBody(AccessorDeclarationSyntax)Returns accessor body or an expression body if the body is null.
BodyOrExpressionBody(ConstructorDeclarationSyntax)Returns constructor body or an expression body if the body is null.
BodyOrExpressionBody(ConversionOperatorDeclarationSyntax)Returns conversion operator body or an expression body if the body is null.
BodyOrExpressionBody(DestructorDeclarationSyntax)Returns destructor body or an expression body if the body is null.
BodyOrExpressionBody(LocalFunctionStatementSyntax)Returns local function body or an expression body if the body is null.
BodyOrExpressionBody(MethodDeclarationSyntax)Returns method body or an expression body if the body is null.
BodyOrExpressionBody(OperatorDeclarationSyntax)Returns operator body or an expression body if the body is null.

BodyOrExpressionBody(AccessorDeclarationSyntax)

Returns accessor body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax accessorDeclaration)

Parameters

accessorDeclaration AccessorDeclarationSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(ConstructorDeclarationSyntax)

Returns constructor body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax constructorDeclaration)

Parameters

constructorDeclaration ConstructorDeclarationSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(ConversionOperatorDeclarationSyntax)

Returns conversion operator body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.ConversionOperatorDeclarationSyntax conversionOperatorDeclaration)

Parameters

conversionOperatorDeclaration ConversionOperatorDeclarationSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(DestructorDeclarationSyntax)

Returns destructor body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax destructorDeclaration)

Parameters

destructorDeclaration DestructorDeclarationSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(LocalFunctionStatementSyntax)

Returns local function body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax localFunctionStatement)

Parameters

localFunctionStatement LocalFunctionStatementSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(MethodDeclarationSyntax)

Returns method body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax methodDeclaration)

Parameters

methodDeclaration MethodDeclarationSyntax

Returns

CSharpSyntaxNode

BodyOrExpressionBody(OperatorDeclarationSyntax)

Returns operator body or an expression body if the body is null.

public static Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode? BodyOrExpressionBody(this Microsoft.CodeAnalysis.CSharp.Syntax.OperatorDeclarationSyntax operatorDeclaration)

Parameters

operatorDeclaration OperatorDeclarationSyntax

Returns

CSharpSyntaxNode