LinQ

  • Thread starter Thread starter abcd
  • Start date Start date
A

abcd

I have a list of Custom Objects. Those objects have inner objects. I want to
filter the list based on inner objects. Currently I am using

List.FindAll (SearchPredicate)

My SearchPredicate is a complex function. How LinQ is going to help me..will
that improve the performance than calling FindAll.

Any samples for performing filter. Basically, I want to fire one query and
that should return me list of select objects.

[Pardon me if this is not the right group to discuss this topic.]
 
abcd said:
I have a list of Custom Objects. Those objects have inner objects. I want to
filter the list based on inner objects. Currently I am using

List.FindAll (SearchPredicate)

My SearchPredicate is a complex function. How LinQ is going to help me..will
that improve the performance than calling FindAll.
Probably not. LINQ isn't magic. Finding matching elements in an unsorted
collection is inherently an O(N) operation. If you want to improve that,
you'll need some sort of sorting (pardon the expression).

In general, LINQ will not improve the performance of anything (and there are
a few performance pitfalls to avoid, actually); it's a powerful and uniform
way of querying data over arbitrary providers. LINQ primarily offers
productivity benefits.

This is likely to change in the future, because LINQ queries do offer
opportunities for (transparent) optimization (parallelization in
particular). It's not the primary focus, though.
Any samples for performing filter. Basically, I want to fire one query and
that should return me list of select objects.
As for samples, you can't beat this: http://msdn.microsoft.com/vcsharp/aa336746
 
Back
Top