can someone please help me turn this nested structure into a single LINQ statement?
EventLog[] logs = EventLog.GetEventLogs();
for (int i = 0; i
I have this solution, and I'm assuming that remoteAccessLogs is of type List
remoteAccessLogs.AddRange(
from log in EventLog.GetEventLogs()
from entry in log.Entries.Cast()
select entry
);
I forgot about the where clauses
List remoteAccessLogs = new List();
remoteAccessLogs.AddRange(
from log in EventLog.GetEventLogs()
where log.LogDisplayName.Equals("AAA")
from entry in log.Entries.Cast()
where entry.Source.Equals("BBB")
select entry
);