How can I get a total of the count of some columns in a list using LINQ and put this into an object?
I have a list that
List<History> a = getTodayData();
where my class History looks like this:
public class History
{
public Int32 Id { get; set; }
public string YYMMDD { get; set; }
public int Quiz { get; set; }
public int Views { get; set; }
public int Clicks { get; set; }
public int Points { get; set; }
}
What I would like is to populate this object with the totals for each of Views, Clicks and Points.
public class Today
{
public int Views { get; set; }
public int Clicks { get; set; }
public int Points { get; set; }
}
Some help / advice would be much appreciated.