var Total = gen.InvoiceDetails.Sum(x => x.TotalPrice);
var Total = gen.InvoiceDetails.ToList().Sum(x => x.TotalPrice);
var Total = gen.InvoiceDetails.AsEnumerable().Sum(x=>x.Field<int>("TotalPrice"));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)