0

I need a get method for a readonly attribute

 public readonly string accountNumber { get;}

doesn't work. Is there a way to create a get methode without creating a new extra attribute?

pnuts
  • 58,317
  • 11
  • 87
  • 139
vanlooverenkoen
  • 2,121
  • 26
  • 50

1 Answers1

0

The answer of Brad M was correct, if you use a get without readonly, the property is by default readonly, so you dont have to write it again. thanks

Community
  • 1
  • 1
vanlooverenkoen
  • 2,121
  • 26
  • 50