One of the requirements of a module I am currently building requires me to select data using Linq but the ids are being passed to me thru an integer array
var CheckedArray = Request["doc_download"];
string[] detailIds = CheckedArray.Split(',');
List<int> dtIds = new List<int>();
foreach (string words in detailIds)
{
dtIds.Add(Int32.Parse(words));
}
using (var ctx = new Connect2020Entities())
{
DetailList = (from userDetail in ctx.DocumentDetail
where userDetail.ID == <!-- items in dtIds --> //<<I do not know what could be used to compare all of the data from the array in a single query>>
select new DetailList()
{
FilePath = userDetail.FilePath
}).ToList<UserDocument>();
}
What could be done so that all of the ids inside the integer array can be compared inside the query in one go. I currently could not think of a viable logic that will allow the values in the array to be used as parameters in the query I am using.
*The DocumentDetail field ID is an integer.