c# - List Filtering in Linq -
i have 2 lists. 1 list of ids. i've filter second list having ids in former list only. that, i've written below code
var clientidlist = list.groupby(p => new {p.companyname, p.userid}) .select(s => s.min(m => m.id)); var olist = list.where(x => clientidlist.contains(x.id)) .orderby(x=>x.companyname).tolist();
but think there wrong in it. can me?
Comments
Post a Comment