thể trùng lặp:
What's the use/meaning of the @ character in variable names in C#?
C# prefixing parameter names with @LINQ, lambda và @
tôi cảm thấy như tôi nên biết điều này và tôi thấy không thể google. Dưới đây là đoạn trích từ một số mã LINQ mà tôi đã xem:
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();
Tiền tố '@' có nghĩa là gì trong ngữ cảnh này?
Ha! Tôi biết đó là điều tôi nên biết. Cảm ơn! – Niklas
@Jon Skeet: :) .... –