On a recent Dot Net Rocks podcast, Jon Skeet mentioned possible abuses of LINQ syntax. What examples have people seen where crazy things are being done with LINQ?
相关问题
- Check if tie in count of lists using linq
- Trouble with OR in Sharepoint CAML
- get key value pairs from xml using linq
- query and create objects with a one to many relati
- select column from dataset using LINQ
相关文章
- 想问问Linq中有没有根据条件选择要不要关联表。
- Why do I need a ToList() to avoid disposed context
- LINQ .Include() properties from sub-types in TPH i
- Can a method chain be called LINQ?
- Get grouped comma separated values with linq
- How does a LINQ expression know that Where() comes
-
Creating dynamic Expression
> - Entity Framework - An item with the same key has a
It has to be a ray-tracer implemented in a single LINQ expression. Clever, beautiful, and scary all at the same time!
Here are my own abuses - purely for the sake of having a laugh at a geek night, and demonstrating what the compiler actually does with query expressions.
Arguably my "LINQ to Mandelbrot" is a bit abusive too :)
I was particularly thinking of abuse of the syntax by the way, but there are always plenty of ways to abuse the very presence of LINQ - doing things "the LINQ way" when there are simpler approaches available without using LINQ. For instance, getting to the
n
th element of an array:I suspect there will be more cases of abuse like this than abusing the power of query expressions, partly because many devs won't realise that abusing query expressions will even work :)
Honestly, it's got to be cases where people chose the LINQ syntax where the code to do so:
One of the "best" ones I've ever seen is from thedailywtf.com