Please help solve my problem.
I want get all strings with required id. I have a list with id.
Example = [1,2,3,4,5]
Query:
db.Sites.Where(c => c.Id == /*{get list this}*/)
.Select(c => c.Name)
.FirstOrDefault()
Thanks
Please help solve my problem.
I want get all strings with required id. I have a list with id.
Example = [1,2,3,4,5]
Query:
db.Sites.Where(c => c.Id == /*{get list this}*/)
.Select(c => c.Name)
.FirstOrDefault()
Thanks
Try
db.Sites.Where(c => list.Contains(c.Id)).Select(c => c.Name).ToArray();
This should return all the names as an array with matching Ids in the list.