I am wondering if there is a way to create a concatenated WHERE clause using an array of int. I need to get the results for the entire array combined. Can I do something like:
public ViewResult Results(int? programId, int? programYear, int? programTypeId, string toDate, string fromDate, int?[] programTypeIdList, int?[] programIdList)
{
surveyResponseRepository.Get().Any(x => x.ProgramId == programIdList);
}
Use
Contains:Though that will tell you if ANY result meets that criteria.
I suspect you want to use
Whereinstead ofAny:Also, why are you using an array of nullable
ints? If you’re trying to make the parameter optional, just leave it as an array of regularints and check for null: