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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -