public class Demo
{
private List<string> _items;
private List<string> Items
{
get
{
if (_items == null)
_items = ExpensiveOperation();
return _items;
}
}
}
Other methods in the Demo
class will have access to the _items
field. Since I'm using a property to lazy load the items, I do not want another developer to mistakenly try to use the _items
field.
I know there is the ObsoleteAttribute that I may use, but this field isn't technically obsolete.
Is there a better way to mark a member as "do not use"?