diff --git a/CSharp.Nixill/src/Grid/DataTableParser.cs b/CSharp.Nixill/src/Grid/DataTableParser.cs index b1cf267..6dc819e 100644 --- a/CSharp.Nixill/src/Grid/DataTableParser.cs +++ b/CSharp.Nixill/src/Grid/DataTableParser.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Data; using System.IO; +using System.Linq; using Nixill.Utils; namespace Nixill.Collections.Grid.CSV; @@ -54,6 +55,15 @@ public static DataTable EnumerableToDataTable(IEnumerable input, types.Add(typeof(string)); } } + + if (primaryKey != null) + table.PrimaryKey = primaryKey.Select(x => table.Columns[x]).ToArray(); + + isHeaderRow = false; + } + else + { + } } }