I am trying to return
an `array with distinct records. But this piece of code isn’t working. What am I doing wrong?
return table.AsEnumerable().Distinct(DataRowComparer.Default).ToArray();
I am trying to return
an `array with distinct records. But this piece of code isn’t working. What am I doing wrong?
return table.AsEnumerable().Distinct(DataRowComparer.Default).ToArray();
table
.AsEnumerable()
.GroupBy(row => row.Field<DataType>("FieldName"))
.Select(group => group.First())
.ToArray()