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

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -