I have a class that looks like this:
public class someClass
{
public someclass()
{
someString = "ABC";
}
public string someString
{
get => someString;
set => someString = value;
}
}
I understand that get
and set
are used for accessing and writing values to private fields. In my case, I am running into a stack overflow when I invoke 'someString', and I also know why (because the 'set' gets invoked in an infinite loop).
Can I do something to retain this implementation and not run into a stack overflow?