'将一行数据转换为 object
Dim dr As DataRow = Args(0)
Dim jo As New JObject
For Each dc As DataCol In dr.DataTable.DataCols
'要跳过的
Dim skips() As String = {"create_by", "create_time", "update_by", "update_time", "cs_password"}
'添加jobject,不是排除字段,不为空,不是表达式列
If Array.Indexof(skips, dc.Name) = -1 AndAlso dr.IsNull(dc.Name) = False AndAlso dc.Expression > "" Then
jo(dc.Name) = dr(dc.Name).ToString
Else
Continue For
End If
Next
Return jo
如上代码。临时列有些是表达式列,有些没有表达式。无表达式的是做为字典使用的。