0

I'm using lambda expression in LINQ. When i build it shows

'No overload for method FindAll takes 0 arguments'

//Code:

        List<Dispatch> lstDispatch = dataLayer.LoadDispatchDetails(val);

       lstDispatch = lstDispatch.FindAll().Where(dispatch => dispatch.InvoiceStatus != "Delivered" && dispatch.IsActive=1);

Why?

1
  • I tried that. But, The left hand side of the assignment must be a variable, property or indexer. I'm getting this error. Commented Sep 29, 2013 at 19:24

1 Answer 1

4

You invoke FindAll without any predicate. It should be something like this

var result = lstDispatch.FindAll(dispatch => dispatch.InvoiceStatus != "Delivered" && dispatch.IsActive==1);
Sign up to request clarification or add additional context in comments.

3 Comments

I think the last condition should be dispatch.IsActive == 1. Anyway, this is the solution. +1
@SanthoshKumar answerers commonly copy your code and modify without noticing that your code is wrong seriously. That's why it didn't work for you.
@SanthoshKumar I just tried to use your variable convention, but obviously i did it wrong. Just use another variable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.