次のコードをLinq形式に縮小する方法はありますか?
foreach (var current in currentWhiteListApps)
{
    var exists = false;
    foreach (var whiteList in clientSideWhiteLists)
    {
       if (current.appID.Equals(whiteList.appID))
       {
           exists = true;
       }
    }
    if (!exists)
    {
        deleteList.Add(current);
    }
}
私が考えることができるのは:
currentWhiteListApps.Select(x => {
    var any = clientSideWhiteLists.Where(y => y.appID.Equals(x.appID));
    if (any.Any())
        deleteList.AddRange(any.ToArray());
    return x;
});
Reason For LINQ
LINQは、ネストされたforeachループよりもはるかに読みやすく、必要なコードも少なくて済みます。だからこれが私がそれを望んでいる理由ですLINQ