I want to retrieve common element from list and want to show in below format.
I have a List<Property>
, the Property
class is as follows:
public class Property
{
public Property(){}
public string Name { get; set; }
public string Value { get; set; }
}
Value of list are as below:
Name Value
---------------
Sam --> 1
Sam --> 2
Sam --> 5
mike --> 2
mike --> 3
Expected result
I wanted to display common items with comma separated values as shown below:
Name Value
-------------------
Sam --> 1, 2, 5
mike --> 2, 3