Class DataSetExtensions
Data set extension methods
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Report
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public static class DataSetExtensions
Methods
AsDictionary(DataSet)
Get data set table rows values as dictionary
Declaration
public static Dictionary<string, List<Dictionary<string, object>>> AsDictionary(this DataSet dataSet)
Parameters
| Type | Name | Description |
|---|---|---|
| DataSet | dataSet |
Returns
| Type | Description |
|---|---|
| Dictionary<string, List<Dictionary<string, object>>> | The data table values as dictionary, key is table column name |
HasRows(DataSet)
Test for data set rows
Declaration
public static bool HasRows(this DataSet dataSet)
Parameters
| Type | Name | Description |
|---|---|---|
| DataSet | dataSet |
Returns
| Type | Description |
|---|---|
| bool | True if any row is available |
Json(DataSet, JsonNamingPolicy, bool)
Get data set as json
Declaration
public static string Json(this DataSet dataSet, JsonNamingPolicy namingPolicy = null, bool ignoreNull = true)
Parameters
| Type | Name | Description |
|---|---|---|
| DataSet | dataSet | |
| JsonNamingPolicy | namingPolicy | Naming policy (default: camel case) |
| bool | ignoreNull | Ignore null values (default: true) |
Returns
| Type | Description |
|---|---|
| string |