I'm having a table which contains userId, regBy, regDate and so many..
I need a out of regDate, regBy and count(userId).
How can a query this using LINQ..
I'm having a table which contains userId, regBy, regDate and so many..
I need a out of regDate, regBy and count(userId).
How can a query this using LINQ..
From what I understand, you want to group by two fields, regDate and regBy. In that case, the select statement looks something like this:
var myQuery = from User myUser in myContext.Users
group myUser by new { regDate = myUser.regDate , regBy = myUser.regBy } into g
select new
{
regDate = g.Key.regDate,
regBy = g.Key.regBy,
Count = g.Count()
};