How can i use group by two id's; I have data like
empid: 1, usrid: 1, profid: 1
empid: 1, usrid: 1, profid: 2
empid: 2, usrid: 1, profid: 5
I have written query like
var query = (from i in data
group i by new { i.empid, i.usrid} into g
select new {
profileid = g.Select(z=>z.profileid).ToArray()
}).ToArray();
Now for the empid:1
and usrid:1
i want to get profile id as an array of 1,2
and for empid:2
and usrid:1
i want to get prof id
as 5
But i am getting all the three values in each record like 1,2,5
How can i get that using linq