can someone please help me turn this nested structure into a single LINQ statement?
EventLog[] logs = EventLog.GetEventLogs();
for (int i = 0; i
Try this:
EventLog[] logs = EventLog.GetEventLogs();
remoteAccessLogs.AddRange(
logs.Where(l => l.LogDisplayName.Equals("AAA"))
.Select(l => l.Entries)
.Where(le => le.Source.Equals("BBB"));
However if performance is an issue I would expect this has at least the same algorithmic complexity, if not worse, as we are iterating over the list again to AddRange.