-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
axunonb
Sep 19, 2023
Replies: 1 comment
-
// convert DataRow to Dictionary<string, object?>
if (dataItem is DataRow row)
{
dataItem = row.Table.Columns.Cast<DataColumn>().ToDictionary(c => c.ColumnName, c => row[c]);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Cirkadia
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DataRow
is not a built-inISource
.Some years ago I came across the same requirement, and actually it's a "one-liner" (probably the same as you found, and I'm not sure whether any better exists):