I have a structure like this:
public struct MyStruct
{
public string Name;
public bool Process;
}
And I have myStruct list as follows:
"123", true
"123", false
"234", true
"345", false
"456", true
"456", false
I want to use LINQ to return a list as follows:
"123", false
"234", true
"345", false
"456", false
So basically, I want to get a list of different names ("123", "234", ... etc.) along with a boolean flag, and if the names are repeated, I need to perform an AND operation on the flag.
Is there an easy way to do this with a single LINQ statement?
source
share