Is constructing and using a manual lookup (ILookup<T>
) approach any faster than using a join with Join
or GroupJoin
on a local IEnumerab开发者_运维问答le<T>
sequence in LINQ?
I read somewhere that the compiler actually translates the inner sequence of Join
and GroupJoin
to ILookup<T>
anyway.
What would ILookup<T>
benefits of using it on it's own be?
It depends. If you're working with objects that are DataContext based, then the join gets translated all the way down into the SQL server via the select statement. IF its a POCO (or more specifically a Plain Old CLR collection) or something else, then yes, its utilized as ILookup.
精彩评论