How to preserve indentation in chained methods

We have fluent-style object validation:


ForProperty(person => person.Lastname)   .If(person => person.Lastname.StartsWith("A"))     .Execute(Validate1)   .Else()     .Execute(Validate2);

When I format this piece of code with ReSharper I get this:


ForProperty(person => person.Lastname)   .If(person => person.Lastname.StartsWith("A"))   .Execute(Validate1)   .Else()   .Execute(Validate2);


Is there an option to prevent ReSharper from changing the indentation?

1 comment
Comment actions Permalink

Hello Bjorn

  Unfortunately, there is no way to disable R# formatting for some piece of code - https://youtrack.jetbrains.com/issue/RSRP-187963.

Thanks!

0

Please sign in to leave a comment.