LinQ

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.]
 
J

Jeroen Mostert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top