Reflecting parameter name: abuse of C# lambda expressions or syntax brilliance? [closed]

I find that odd not so much because of the name, but because the lambda is unnecessary; it could use an anonymous-type and be more flexible:

.Attributes(new { style = "width:100%", @class="foo", blip=123 });

This is a pattern used in much of ASP.NET MVC (for example), and has other uses (a caveat, note also Ayende’s thoughts if the name is a magic value rather than caller-specific)

Leave a Comment