how to query items with any id in a list of ids linq c#

49

linq where id in list -

var result = _dataContext.table.Where(x => idList.Contains(x.Id));

how to query items with any id in a list of ids linq c# -

var userProfiles = _dataContext.UserProfile
                               .Where(t => idList.Contains(t.Id));

Comments

Submit
0 Comments