• marcos@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    5
    ·
    2 days ago

    Da fuck?!

    Where doe it declare it’s a public property? Is it some kind of default now? Everything you write becomes one?

    • hdsrob@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 days ago

      It’s an Expression-Bodied Member (available since C#6). The expression (=>) is just syntactic sugar that the compiler recognizes as a single line property with only a getter (under the hood both versions compile the same).