Imports System.Collections.Generic
Public ColumnList As New List(Of Column)()
Public RowList As New List(Of Row)()
Public CellList As New List(Of Cell)()
data.ColumnList.Add(New Column() With {.name = "FieldA"})
data.ColumnList.Add(New Column() With {.name = "FieldB"})
row.CellList.Add(New Cell() With {.value = 1, .col = data.ColumnList(0)})
row.CellList.Add(New Cell() With {.value = 2, .col = data.ColumnList(1)})
row.CellList.Add(New Cell() With {.value = 34, .col = data.ColumnList(0)})
row.CellList.Add(New Cell() With {.value = 2, .col = data.ColumnList(1)})
Console.WriteLine(IsPK_CustomData(data, New String() {"FieldB"}))
Console.WriteLine(IsPK_CustomData(data, New String() {"FieldA", "FieldB"}))
Private Function IsPK_CustomData(data As Data, ParamArray fields As String()) As Boolean
Dim keyValues = data.RowList _
.[Select](Function(r) r.CellList.Where(Function(c) fields.Contains(c.col.name)) _
.[Select](Function(c) c.value).ToArray()).ToArray()
For i As Integer = 1 To keyValues.Length - 1
For j As Integer = i - 1 To 0 Step -1
If keyValues(i).SequenceEqual(keyValues(j)) Then