Hello Everyone, I am having troubles on finding a way to refactor my nested foreach code into a Linq, mostly because it includes an IF-Else clause into it.
Below is a simplified version of my code. How do I include the IF..Else into a linq statement??
I appreciate your suggestions.
List<hierarchy> PredomHierarchy; List<hierarchy> RecesesHierarchy; foreach x in PredomHierarchy{ foreach y in RecesesHierarchy{ if(x.name = y.name) { Dosomething(x.name, y.name); } else { DosomethingElse(x.name, y.name); } }}