I have a class Foo as follows.
public class Foo
{
public string Name { get; set; }
public string Value { get; set; }
}
I have a collection of this class let’s say List and sometimes I have data as follows in collection.
Name Value Jimmy hello Jimmy World Peter how Peter are you? Suzanne I am fine
I want to combine the value field for same Names as folows
Name Value Jimmy hello World Peter how are you? Suzanne I am fine
Is there anyway this could be accomplished using Linq?
You can use the Linq
GroupByas follows: