1

How can i compare array of elements with the linq query. I will pass array of elements to the controller and i want to compare and display the records that only contains the passed elements.

I will pass an array of values like ["first","second","third"] and i want to compare these records with the linq query and generate the result that contains these three records

1 Answer 1

2

I'm not sure but you probably want something like this

String[] values = {"first", "second", "third"};

List<YourObject> query = 
    (from p in this.db.table 
    where values.Contains(p.values) select p).ToList();
Sign up to request clarification or add additional context in comments.

Comments

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.