c# - LINQ query for retrieving data from list -



c# - LINQ query for retrieving data from list -

i have list collection of message objects.

public class message { public int id { get; set; } public string body { get; set; } public string sender { get; set; } public datetime timestamp { get; set; } }

i want 1 message recent timestamp each sender. how do using linq?

var q = n in table grouping n n.senderinto g select g.orderbydescending(t=>t.timestamp).firstordefault();

c# linq

Comments

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -