linq where Contains in IEnumerable

handaishere

New Member
\[code\]//\\ ---- selected items from ChechBoxListIEnumerable<int> selSender = (from ListItem item in CheckBoxList1.Items.OfType<ListItem>() where item.Selected select Convert.ToInt32(item.Value));//\\ --- linq queryvar messages = from m in myEntities.Messagesselect new {m.Id,m.MessageText,m.CreatedByUserID};\[/code\]my problem is: i need to get data filtered by selected items from CheckBoxList "selSender"I tried the following:\[code\] RadGrid1.DataSource = messages.Where(m => selSender.Contains(m.CreatedByUserID));\[/code\]But it's not working, error message:Instance argument: cannot convert from 'System.Collections.Generic.IEnumerable' to 'System.Linq.IQueryableHow can i get data contains based on selSender id's?
 
Back
Top