Skip to main content
1 of 5
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

If you want to declare a setter, you must set the property equal to the incoming value.

public String userInput
{
    get { return userInput; }
    set { userInput = value; }
}

You can also use the simplified form here since you are not doing anything more fancy:

public String userInput { get; set; }
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431