You are on page 1of 1

//var AgendaList = ( from f in db.

Agenda
// group f by new {f.cod, f.nombre, f.apellido_pat}
// into myGroup
// where myGroup.Count() > 0
// select new
// {
//
myGroup.Key.cod,
//
myGroup.Key.nombre,
//
myGroup.Key.apellido_pat,
//
Y2006 = myGroup.Where(f => f.FinancialYear == 2006).Sum(c =>c.
FinancialValue),
//
Y2007 = myGroup.Where(f => f.FinancialYear == 2007).Sum(c =>c.
FinancialValue),
//
Y2008 = myGroup.Where(f => f.FinancialYear == 2008).Sum(c =>c.
FinancialValue),
//
Fin = myGroup.Count()
// }

You might also like