Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protected Internal properties vs Protected properties and Resharper

I've just picked up Resharper and have been playing around converting fields to properties. I want these properties to be protected, but Resharper doesn't want to give me that option. Instead there is only a Protected Internal option. This has me thinking. Either there is a rule somewhere that properties should always be 'protected internal' rather than just 'protected'. Or I just don't know how to use resharper. Which is it?

Update: Contacted Jetbrains themselves and they have identified this behaviour as a bug and raised a bug report. Marc's answer is essentially correct on the usage of 'protected internal' so he gets the tick.

like image 201
Steve Mc Avatar asked Jul 03 '10 10:07

Steve Mc


1 Answers

What are the fields at the moment? public? I wonder if you have some code in other types that is already touching the properties, and thus would break if they were just protected. I don't know how resharper feels about it, but it is not necessary (or even particularly common) to make things protected internal - so protected should be a reasonable option.

like image 89
Marc Gravell Avatar answered Oct 13 '22 00:10

Marc Gravell