I am trying to re-write the following using LINQ
foreach (WMCommon.Services.StakeOut.assembly ass in assemblies)
{
foreach (var agg in aggregate)
{
I am hoping that the LINQ will be much faster than nested FOREACH?
In general, LINQ isn't going to improve your performance unless you change how it works. LINQ is effectively just performing the iterations for you.
In this case, it appears you could just use a join to improve this overall, as this is going to give you the same effect:
var query = from WMCommon.Services.StakeOut.assembly ass in assemblies
join agg in aggregate
on new { ass.unitActn, ass.unitCode, ass.unitLength } equals new { (agg.catagory.unitActn, agg.catagory.unitCode, agg.catagory.unitLength }
select new { ass, agg };
foreach(var pair in query)
pair.ass.quantity = pair.agg.qty;