How do I use a C# reserved keyword as a property name without the @ prefix?

后端 未结 3 951
旧时难觅i
旧时难觅i 2020-12-20 15:59

I need to design a class where one property name has to be return, but when I create a property name like return then I get an error.

Afte

3条回答
  •  我在风中等你
    2020-12-20 16:16

    No way to achieve this because reserved Keywords are predefined, reserved identifiers that have special meanings to the compiler.

    it's better you change name of property and use it in you code...something as given in @Marc answer...

提交回复
热议问题