I'm trying to learn LINQ by practice. This seems like a situation where I should be able to use it, but I can't quite figure out if it's possible or if I'm barking up the wrong tree.
Can I achieve what's in the brackets [] with a one-liner LINQ query given the use case below?
List<Command> list1, list2;
PopulateCommandLists(list1, list2);
foreach(Command cmd in list1)
{
if ([cmd.Name is present as the Name in any of list2's Command objects])
{
//some code.
}
}