You cannot use these conversion functions in the LINQ to Entities statement, they cannot be translated into SQL, you need to do the in-memory transformations. But I donβt think you need to do this at all.
If you used resultMap to get the resultList filtered by Results from which Id present in mapResult , follow these steps:
var resultList = db.Result_DE .Where(r => r.IsActive == "1" && mapResult.Any(mr => mr.ResultDE == r.ID)); .ToList();
If mapResult is a collection in memory and not an IQueryable that is bound to the db context, you need to do the following:
var resultIds = mapResult.Select(mr => mr.ResultDE).ToList(); var resultList = db.Result_DE .Where(r => r.IsActive == "1" && resultIds.Contains(r.ID)); .ToList();
source share