From a93c035e8c884874c5f4074a6b1d2360c9f08eab Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 23 Aug 2024 14:45:06 -0400 Subject: [PATCH] tiny more work --- CSharp.Nixill/src/Grid/DataTableParser.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 + { + } } }