Skip to content

Expression body syntax or statement bodies? #11

Open
@YVbakker

Description

@YVbakker

In .editorconfig it's set to csharp_style_expression_bodied_methods = false:suggestion

However, in build/.editorconfig this is set to csharp_style_expression_bodied_methods = true

Which one is preferred and why? In what cases?

I ask because I can see most methods use a statement body while not always necessary, but for example in https://github.com/dendrodocs/dotnet-shared-lib/blob/main/src/DendroDocs.Shared/Descriptions/TypeDescription.cs expression bodies are used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityImprovements to code style, structure, or coverage without adding new features or fixing bugs.documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions