What is the purpose of @ as part of a member name in C#?
Posted
by thelaughingdm
on Stack Overflow
See other posts from Stack Overflow
or by thelaughingdm
Published on 2010-04-16T14:33:34Z
Indexed on
2010/04/16
14:43 UTC
Read the original article
Hit count: 113
c#
|web-services
As you can imagine, Googling or Binging for any phrase containing an '@' is difficult.
In creating a new web service, one of the members of the imported C# proxy class is prefixed with the @. For example:
plan.@event = new Insurance.Event();
I assume that it is Visual Studio's way resolving potential conflicts with reserved words because 'event' is a reserved word. Changing the property in the web service interface to something other than 'event' (i.e. 'healthevent') removes the @ from the property. Is this a correct assumption?
© Stack Overflow or respective owner