LINQ in Action roller

Linq Group by multiple columns + Aggregate Function

This is my query in Tsql : SELECT TOP 10 [ActionID], [ActionType], [ObjectID], MAX(date) FROM [dbo].[UserHistory] WHERE [EntityType] = 3 AND [UserID] = 1 GROUP BY [ActionID], [ActionType], [ObjectID], ORDER BY MAX(date) desc Following the other thread post about Linq group by multiple columns, I came up with the following linq query: var result = from i in (from uh in db.UserHistories where uh.User.UserID == UserID && uh.CRMEntityID == (int)entity select new { uh.ActionID, uh.ActionType, uh.ObjectID Read More...
Published Tuesday, April 29, 2008 12:50 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication