SerializableDataTable 1.0.3
See the version list below for details.
dotnet add package SerializableDataTable --version 1.0.3
NuGet\Install-Package SerializableDataTable -Version 1.0.3
<PackageReference Include="SerializableDataTable" Version="1.0.3" />
<PackageVersion Include="SerializableDataTable" Version="1.0.3" />
<PackageReference Include="SerializableDataTable" />
paket add SerializableDataTable --version 1.0.3
#r "nuget: SerializableDataTable, 1.0.3"
#:package SerializableDataTable@1.0.3
#addin nuget:?package=SerializableDataTable&version=1.0.3
#tool nuget:?package=SerializableDataTable&version=1.0.3
<img src="https://github.com/jchristn/SerializableDataTable/blob/main/assets/icon.png?raw=true" data-canonical-src="https://github.com/jchristn/SerializableDataTable/blob/main/assets/icon.png?raw=true" width="128" height="128" />
SerializableDataTable
SerializableDataTable is a library providing an abstraction class that allows you to serialize and deserialize data to and from a DataTable
instance.
Help, Feedback, Contribute
If you have any issues or feedback, please file an issue here in Github. We'd love to have you help by contributing code for new features, optimization to the existing codebase, ideas for future releases, or fixes!
New in v1.0.x
- Initial release
- Added markdown support
Example
Refer to the Test
project for exercising the library. This is example is using the NuGet package SerializationHelper for simplicity purposes.
using System.Data;
using SerializableDataTables;
using SerializationHelper;
// Create your DataTable and columns
DataTable dt1 = new DataTable("Test");
dt1.Columns.Add("id", typeof(int));
dt1.Columns.Add("name", typeof(String));
// Create your DataRows
dt1.Rows.Add(1, "Hello");
dt1.Rows.Add(2, "World");
SerializableDataTable sdt = SerializableDataTable.FromDataTable(dt);
string json = Serializer.SerializeJson(sdt, true);
Console.WriteLine("JSON: " + Environment.NewLine + json + Environment.NewLine);
/*
{
"Name": "Test",
"Columns": [
{
"Name": "id",
"Type": "Int32"
},
{
"Name": "name",
"Type": "String"
}
],
"Rows": [
{
"id": 1,
"name": "Hello"
},
{
"id": 2,
"name": "World"
}
]
}
*/
DataTable dt2 = Serializer.DeserializeJson<SerializableDataTable>(json).ToDataTable();
Supported Data Types
This library supports the following DataTable
value types: string
, Int32
, Int64
, decimal
, double
, float
, bool
, DateTime
, DateTimeOffset
, byte
, byte[]
, char
, Guid
, and Object
.
Conversion to Markdown
The SerializableDataTable
class has a public method ToMarkdown()
which returns a markdown string.
The static class MarkdownConverter
can be used with a DataTable
or a SerializableDataTable
to produce a markdown string.
using System.Data;
using SerializableDataTables;
SerializableDataTable sdt = ...;
string md = sdt.ToMarkdown();
md = MarkdownConverter.Convert(sdt); // full markdown
Console.WriteLine(MarkdownConverter.ConvertHeaders(sdt)); // show only header row and separator row
foreach (string str in MarkdownConverter.IterateRows(sdt))
{
Console.Write(str); // print each data row, which has a newline separator already added
}
Version History
Refer to CHANGELOG.md for version history.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.1
- System.Text.Json (>= 8.0.5)
-
net6.0
- System.Text.Json (>= 8.0.5)
-
net8.0
- System.Text.Json (>= 8.0.5)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on SerializableDataTable:
Package | Downloads |
---|---|
View.Sdk
C# SDK for View AI. |
|
DocumentAtom
Core classes for DocumentAtom. Download the DocumentAtom package specific to the content types you wish to process. DocumentAtom provides a light, fast library for breaking input documents into constituent parts (atoms), useful for AI, machine learning, processing, analytics, and general analysis. |
|
SemanticCells
Semantic cells are data structures useful for parsing and organizing content for use in AI and analytics |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release