Im not sure wether this is possible or not. I’d like to create an array (or list/dictionary) containing some simple id’s and the use the array (or whatever) in a lambda expression.
The example below should return the UserId’s 15850 and 15858
DbDataContext db = new DbDataContext();
int[] userIds = {15850, 15858};
var users = db.tblUsers.Where(x => x.UserId.Equals(userIds));
Possible or not?
Thanks
It’s possible, and will translate into a SQL
WHERE IN (...)statement, but it is written kind of backwards in linq: