How do I use a C# reserved keyword as a property name without the @ prefix?
问题 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. After some research I found out that one can use a reserved keyword as a property or variable name by adding a @ prefix in C#, or by enclosing it in square brackets [] in VB.NET. For example: var @class = new object(); So here is my class design code. public class Person { string _retVal; public string @return { get { return _retVal; } set { _retVal = value; }