0

I need to find all the records where the TestEventId exists in my int array. What is the good way to do it? Basically I am looking for:

 int[] testevents = McTestEventService.ReadTestEventsforTestCenter(testcenterid);
        var testcentercandidates =
            context.McTestCandidateRegistration.Where(m =>m.McTestEventId is in(testevents[]) ).ToList();

Suggestions? I can find a work around but thought may be I will ask if there is any neat solution.

2 Answers 2

1
 int[] testevents = McTestEventService.ReadTestEventsforTestCenter(testcenterid);
        var testcentercandidates =
            context.McTestCandidateRegistration.Where(m=>testevents.Contains(m.McTestEventId)).ToList();
Sign up to request clarification or add additional context in comments.

Comments

1

Are you looking for:

.Where(m => testevents.Contains(m.McTestEventId))

?

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.