KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
public List<string> GetpathsById(List<long> id) { long[] aa = id.ToArray(); long x; List<string> paths = new List<string>(); for (int i = 0; i < id.Count; i++) { x = id[i]; Presentation press = context.Presentations.Where(m => m.PresId == aa[i]).FirstOrDefault(); paths.Add(press.FilePath); } return paths; } This code throws the following exception: The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities. However, if I supply x instead of aa[i] it works. Why?
Tags (comma-separated)
Save Edits
Cancel