Linq, lambda and @

Possible duplicate:
What is the use / value of the @ symbol in variable names in C #?
C #, prefix parameter names with @

It seems to me that I should know this, and I believe that this is impossible for Google. Below is a snippet of some Linq code that I came across:

private static readonly Func<SomeEntities, someThing, List<someThing>> GetReplacement =
(someEntities, thing) => someEntities.someReplacement.Join(someEntities.someThing,
                           replaces => replaces.new_thing_id,
                           newThing => newThing.thing_id,
                           (rep, newThing) => new {rep, newThing}).Where(
                               @t => @t.rep.thing_id == thing.thing_id).
 Select
 (
     @t => @t.newThing
 ).ToList().Distinct(new SomeThingComparer()).ToList();  

What does the prefix '@' mean in this context?

+5
source share
1 answer

Typically, the prefix is @used if you need to use a keyword as an identifier, for example a variable name:

string @string = "...";

The c # spec says the following (my highlight):

"@" , . @ , . @ . @ , , , .

t , , @ .

+14

All Articles