Hello Friends,
I been trying to write the following code in expression based way but not sure how can i do that assignment to the object after comparison. Any help would be highly appreciated.
var pcs = from a in collection
group a by a.TotType
into g
select new
{
TType = g.Key,
SColl = g.Select(r => r)
};
for (int i = 0; i < processResult.PAndLReport.BreakdownTotTypeCollection.Count; i++)
{
foreach (var ttypes in pcs)
{
if (processResult.PAndLReport.BreakdownTotTypeCollection[i].TotType == ttypes.TType)
{
BreakdownCollection coll = new BreakdownCollection();
foreach (var item1 in ttypes.SColl)
{
coll.Add(item1);
}
processResult.PAndLReport.BreakdownTotTypeCollection[i].BreakdownCollection = coll;
}
}
}