ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code syntax style: bodies of type members

Last modified: 26 May 2024

Starting from C# 6.0, you can declare type members using expression bodies, which look very similar to lambda expressions. You can use expression-bodied methods and properties to further simplify the syntax of simple implementations.

If you prefer to stick to either expression-bodied or block-bodied implementations for simple members, ReSharper lets you configure your preferences separately for different kinds of members and maintain the consistency of your preferences throughout your codebase.

ReSharper helps you enforce preferences for expression-bodied members in the existing code and takes your preferences into account when it produces new code with code completion and code generation features, applies code templates and performs refactorings.

This feature is supported in the following languages and technologies: