What does "@" mean in a lambda expression

Possible duplicate:
What does placing @ in front of a C # variable name do?

I am trying to learn C # lambda expressions. When I search for examples I see the below code

Where(@t => string.Compare(@t.Code, argument.Code, StringComparison.CurrentCultureIgnoreCase) == 0)

      

I'm wondering what does the "@" symbol in front of the t value mean?

+3


source to share


1 answer


Nothing unusual. You can prefix variable names with @ as a kind of escape if the variable is a keyword.



For example, you can also do "var @ class = 5". Usually you won't be able to compile as class is a keyword, but the @ prefix allows it to be used as varible.

+5


source







All Articles