FluentDataBuilder.Json 1.2.104

dotnet add package FluentDataBuilder.Json --version 1.2.104
NuGet\Install-Package FluentDataBuilder.Json -Version 1.2.104
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluentDataBuilder.Json" Version="1.2.104" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentDataBuilder.Json --version 1.2.104
#r "nuget: FluentDataBuilder.Json, 1.2.104"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FluentDataBuilder.Json as a Cake Addin
#addin nuget:?package=FluentDataBuilder.Json&version=1.2.104

// Install FluentDataBuilder.Json as a Cake Tool
#tool nuget:?package=FluentDataBuilder.Json&version=1.2.104

FluentDataBuilder

html-compiler-tool

License Downloads

.NET Version .NET Version .NET Version

Lines of Code Vulnerabilities Coverage

buy me a coffe

A fluent data builder for json and xml

DataBuilder Output Libraries

FluentDataBuilder has some NuGet-Libraries to generate output:

Package Target NuGet
FluentDataBuilder.Json System.Text.Json NuGet
FluentDataBuilder.NewtonsoftJson Newtonsoft.Json NuGet
FluentDataBuilder.Microsoft.Extensions.Configuration Microsoft.Extensions.Configuration NuGet
FluentDataBuilder.Xml System.Xml NuGet
FluentDataBuilder.Yaml YamlDotNet NuGet

Examples

FluentDataBuilder.Json (System.Text.Json)

install the nuget FluentDataBuilder.Json and follow the general DataBuilder steps. the following code is a sample for the initialization with System.Text.Json.

IDataBuilder builder = new DataBuilder();
...
JsonDocument jsonResult = builder.Build();

FluentDataBuilder.NewtonsoftJson (Newtonsoft.Json)

install the nuget FluentDataBuilder.NewtonsoftJson and follow the general DataBuilder steps. the following code is a sample for the initialization with Newtonsoft.Json.

IDataBuilder builder = new DataBuilder();
...
JObject jsonResult = builder.Build();

FluentDataBuilder.Microsoft.Extensions.Configuration (Microsoft.Extensions.Configuration)

With this package you can store the DataBuilder instance directly as an IConfiguration instance.

install the nuget FluentDataBuilder.Microsoft.Extensions.Configuration and follow the general DataBuilder steps. the following code is a sample for the initialization with Newtonsoft.Json.

IDataBuilder builder = new DataBuilder();
...
IConfiguration configuration = builder.ToConfiguration();

FluentDataBuilder.Xml (System.Xml)

install the nuget FluentDataBuilder.Xml and follow the general DataBuilder steps. the following code is a sample for the initialization with System.Xml.

IDataBuilder builder = new DataBuilder();
...
XmlDocument xmlDocument = builder.Build();

FluentDataBuilder.Yaml (YamlDotNet)

install the nuget FluentDataBuilder.Yaml and follow the general DataBuilder steps..

IDataBuilder builder = new DataBuilder();
...
string yamlContent = builder.Build();

How to create Data Objects

First you need to create an instance:

IDataBuilder builder = new DataBuilder();

Use the Add-Method to add data:

add simple properties

builder.Add("StringProperty", "a value");
builder.Add("NumericProperty", 12345);
builder.Add("BooleanProperty", true);

result (in json):

{
    "StringProperty": "a value",
    "NumericProperty": 12345,
    "BooleanProperty": true
}

add arrays

builder.Add("ListProperty", new List<string> { "this", "is", "a", "test" });
builder.Add("ArrayProperty", new string[] { "this", "is", "a", "test" });
builder.Add("MixedListProperty", new List<object> { "value", 123, true, 456.78 });

result (in json):

{
    "ListProperty":
    [
        "this",
        "is",
        "a",
        "test"
    ],
    "ArrayProperty":
    [
        "this",
        "is",
        "a",
        "test"
    ],
    "MixedListProperty":
    [
        "value",
        123,
        true,
        456.78
    ]
}

add new object

builder.Add("ObjectProperty", new DataBuilder()
    .Add("StringProperty", "another value")
    .Add("NumericProperty", 67890)
    .Add("BooleanProperty", false));

result (in json):

{
    "ObjectProperty":
    {
        "StringProperty": "another value",
        "NumericProperty": 67890,
        "BooleanProperty": false
    }
}
Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FluentDataBuilder.Json:

Package Downloads
FluentDataBuilder.Microsoft.Extensions.Configuration

fluent data builder for json and xml

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.104 459 12/24/2023
1.2.103 119 12/23/2023
1.2.84 142 12/6/2023
1.2.83 148 12/6/2023
1.2.82 109 12/6/2023
1.2.77 155 11/18/2023
1.2.75 87 11/17/2023
1.2.74 149 11/17/2023
1.2.73 110 11/17/2023
1.1.69 180 9/28/2023
1.1.68 181 9/28/2023
1.1.67 112 9/28/2023
1.1.66 122 9/27/2023
1.1.65 118 9/27/2023
1.1.64 102 9/27/2023
1.1.53 151 9/17/2023
1.1.52 176 9/17/2023
1.1.51 117 9/17/2023
1.1.50 95 9/17/2023
1.1.49 118 9/17/2023
1.1.46 103 9/17/2023
1.1.45 100 9/17/2023
1.1.44 100 9/17/2023
1.1.36 142 9/6/2023
1.1.35 141 9/6/2023
1.1.34 120 9/6/2023
1.1.33 119 9/5/2023
1.1.32 96 9/5/2023
1.1.27 163 8/26/2023
1.1.22 179 8/13/2023
1.1.21 128 8/11/2023
1.1.17 132 8/3/2023
1.1.14 129 8/2/2023
1.1.0 130 8/2/2023