i am developing a online test application where have two tables category and subCategory from which i want to select some questions with the help of category and subcategory. something like ( question where category ID in (1) and subcategoryID in (1,2,3,4)
I am getting list of subcategory that is going to pass in query
int[] subCategoryForQuestions=new int[]{1,2,3,4};
var TestDataList = coreDbContext.SolutionMasters
.Where(x => x.CategoryID == categoryID
&& x.DifficultyId == questionLevel
&& subCategoryForQuestions.Contains("here all value in Subcategory"))
.Take(NoOfQuestions);
or something like subcategoryID.contains("some value in array of integer")
can i get some help from anybody?