Refactor to a property and not a private method

Hi, I would like to refactor the following:

 

if(role = "Admin")

   // do something

 

into

private bool IsAdmin

{

  get {...}

}



if(IsAdmin)

  // Do something.


In other words, extract into a property instead to a method.

 

Thanks

Alex

0
1 comment

Hello Alex!

 

Sorry for delay in responding.

THere's no such option in R#. You can try extracting to a method and then converting method to property - https://www.jetbrains.com/help/resharper/Refactorings__Convert_Method_to_Property.html

Thank you.

0

Please sign in to leave a comment.