JetBrains Rider 2021.3 Help

Razor CSharp - CodeStyle

Line breaks around Razor statements

Property names:

[resharper_]html_linebreaks_around_razor_statements, [resharper_]linebreaks_around_razor_statements

Possible values:

true | false

Examples:

true

something @if (a == 1) { @: SomeText } something

false

something @if (a == 1) { @: SomeText } something

Blank lines around Razor @functions block

Property names:

[resharper_]html_blank_lines_around_razor_functions, [resharper_]blank_lines_around_razor_functions

Possible values:

an integer

Examples:

value: 0

something @functions { int Count() { return 1; } } something

value: 1

something @functions { int Count() { return 1; } } something

value: 2

something @functions { int Count() { return 1; } } something

Blank lines around Razor helpers

Property names:

[resharper_]html_blank_lines_around_razor_helpers, [resharper_]blank_lines_around_razor_helpers

Possible values:

an integer

Examples:

value: 0

something @helper Aaa() { @: smth } something

value: 1

something @helper Aaa() { @: smth } something

value: 2

something @helper Aaa() { @: smth } something

Blank lines around Razor sections

Property names:

[resharper_]html_blank_lines_around_razor_sections, [resharper_]blank_lines_around_razor_sections

Possible values:

an integer

Examples:

value: 0

something @section scripts { sdsds } something

value: 1

something @section scripts { sdsds } something

value: 2

something @section scripts { sdsds } something

Override brace style for C# to always use "At end of line (K&R style)"

Property names:

[resharper_]razor_always_use_end_of_line_brace_style, [resharper_]always_use_end_of_line_brace_style

Possible values:

true | false

Remove blank lines after "{" and before "}" in @functions

Property names:

[resharper_]razor_remove_blank_lines_near_braces, [resharper_]remove_blank_lines_near_braces

Possible values:

true | false

Always remove "this." qualifier (override corresponding C# setting)

Property names:

[resharper_]razor_remove_this_qualifier, [resharper_]remove_this_qualifier

Possible values:

true | false

Use fully qualified names for @inherits and @model directives

Property names:

[resharper_]razor_prefer_qualified_reference, [resharper_]prefer_qualified_reference

Possible values:

true | false

Last modified: 07 April 2022