It would seem I've come across a considerable lack in my understanding. I understand it is best practice to use a private variable within a class and access it via a public getter outside said class. Now when using C#s default getter method (private string Image { get; }
) I cannot access the Image
variable outside of this class (Console.WriteLine(items[i].Image);
).
Although I could write a custom public getter, this seems absurd since having a private getter on a private variable that does nothing other than return the variable seems utterly redundant and thus makes me think I'm missing something.