Meziantou.Framework.HumanReadableSerializer
1.0.19
Prefix Reserved
dotnet add package Meziantou.Framework.HumanReadableSerializer --version 1.0.19
NuGet\Install-Package Meziantou.Framework.HumanReadableSerializer -Version 1.0.19
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="Meziantou.Framework.HumanReadableSerializer" Version="1.0.19" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Meziantou.Framework.HumanReadableSerializer --version 1.0.19
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Meziantou.Framework.HumanReadableSerializer, 1.0.19"
#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 Meziantou.Framework.HumanReadableSerializer as a Cake Addin
#addin nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=1.0.19
// Install Meziantou.Framework.HumanReadableSerializer as a Cake Tool
#tool nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=1.0.19
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Meziantou.Framework.HumanReadableSerializer
One-way serializer to an invariant human-readable format. You can use HumanReadableSerializer.Serialize
to convert an object to a string:
var obj = new { Name = "G�rald Barr�", Nickname = "meziantou", Age = 32, MultiLineString = "line1\nline2" };
var output = HumanReadableSerializer.Serialize(obj);
output
contains the following value:
Name: G�rald Barr�
Nickname: meziantou
Age: 32
MultiLineString:
line1
line2
You can customize the serializer using an instance of HumanReadableSerializerOptions
or by using attributes:
var options = new HumanReadableSerializerOptions()
{
IncludeFields = true,
DefaultIgnoreCondition = HumanReadableIgnoreCondition.WhenWritingNull,
};
HumanReadableSerializer.Serialize(obj, options);
Available attributes:
[HumanReadableIgnore]
allows to ignore a property or a field[HumanReadableIncludeAttribute]
allows to include a property or a field[HumanReadablePropertyNameAttribute]
allows to set the name of a property or a field when serializing the value[HumanReadablePropertyOrderAttribute]
allows to order the properties when serializing an object[HumanReadableConverterAttribute]
allows to set the converter to use to serialize a property, a field, or a type
You can customize a type you don't own by using the following:
var options = new HumanReadableSerializerOptions();
// Add the HumanReadableIgnoreAttribute to the User.DisplayName property
options.AddAttribute(typeof(User), "DisplayName", new HumanReadableIgnoreAttribute());
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 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. |
.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 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Json (>= 8.0.0)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Memory (>= 4.5.5)
- System.Text.Json (>= 8.0.0)
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Meziantou.Framework.HumanReadableSerializer:
Package | Downloads |
---|---|
Meziantou.Framework.InlineSnapshotTesting
Enables verification of objects using inline snapshots |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.19 | 19,441 | 12/29/2023 |
1.0.18 | 7,963 | 11/15/2023 |
1.0.17 | 297 | 9/29/2023 |
1.0.16 | 146 | 9/29/2023 |
1.0.15 | 442 | 7/18/2023 |
1.0.14 | 214 | 7/10/2023 |
1.0.13 | 448 | 5/31/2023 |
1.0.11 | 168 | 5/31/2023 |
1.0.10 | 200 | 5/30/2023 |
1.0.9 | 170 | 5/27/2023 |
1.0.8 | 261 | 5/25/2023 |
1.0.7 | 195 | 5/24/2023 |
1.0.5 | 388 | 4/21/2023 |
1.0.4 | 245 | 4/12/2023 |
1.0.3 | 260 | 4/1/2023 |
1.0.2 | 356 | 3/21/2023 |
1.0.1 | 274 | 3/19/2023 |
1.0.0 | 197 | 3/18/2023 |