ktsu.ToStringJsonConverter
1.0.48
Prefix Reserved
dotnet add package ktsu.ToStringJsonConverter --version 1.0.48
NuGet\Install-Package ktsu.ToStringJsonConverter -Version 1.0.48
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="ktsu.ToStringJsonConverter" Version="1.0.48" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.ToStringJsonConverter --version 1.0.48
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ktsu.ToStringJsonConverter, 1.0.48"
#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 ktsu.ToStringJsonConverter as a Cake Addin #addin nuget:?package=ktsu.ToStringJsonConverter&version=1.0.48 // Install ktsu.ToStringJsonConverter as a Cake Tool #tool nuget:?package=ktsu.ToStringJsonConverter&version=1.0.48
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ktsu.ToStringJsonConverter
Overview
ToStringJsonConverter
is a JSON converter factory that simplifies serialization and deserialization of custom types in .NET by leveraging the ToString
and FromString
methods.
Features
- Automatically identifies types with a
FromString
method for custom serialization. - Converts objects to and from JSON using their string representation.
- Supports custom types with static
FromString
methods.
Installation
Install via NuGet:
dotnet add package ktsu.ToStringJsonConverter
Usage
Configure the converter in your JsonSerializerOptions
:
var options = new JsonSerializerOptions();
options.Converters.Add(new ToStringJsonConverterFactory());
Example
public class MyType
{
public string Value { get; set; }
public static MyType FromString(string value) => new() { Value = value };
public override string ToString() => Value;
}
var myType = new MyType { Value = "example" };
string json = JsonSerializer.Serialize(myType, options); // "example"
MyType deserialized = JsonSerializer.Deserialize<MyType>(json, options);
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- ktsu.Extensions (>= 1.2.8)
-
net9.0
- ktsu.Extensions (>= 1.2.8)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ktsu.ToStringJsonConverter:
Package | Downloads |
---|---|
ktsu.AppDataStorage
Application data management library using JSON serialization to save and load data in the user's app data folder. |
|
ktsu.PkmnDB
PkmnDB |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.48 | 380 | 12/27/2024 |
1.0.48-pre.14 | 1 | 1/8/2025 |
1.0.48-pre.13 | 34 | 1/7/2025 |
1.0.48-pre.12 | 37 | 1/5/2025 |
1.0.48-pre.11 | 60 | 1/3/2025 |
1.0.48-pre.10 | 43 | 1/3/2025 |
1.0.48-pre.9 | 43 | 1/3/2025 |
1.0.48-pre.8 | 42 | 1/3/2025 |
1.0.48-pre.7 | 42 | 1/2/2025 |
1.0.48-pre.6 | 64 | 12/31/2024 |
1.0.48-pre.5 | 42 | 12/30/2024 |
1.0.48-pre.4 | 41 | 12/29/2024 |
1.0.48-pre.3 | 37 | 12/28/2024 |
1.0.48-pre.2 | 39 | 12/27/2024 |
1.0.48-pre.1 | 40 | 12/27/2024 |
1.0.47-pre.1 | 36 | 12/27/2024 |
1.0.46 | 262 | 12/26/2024 |
1.0.45 | 77 | 12/26/2024 |
1.0.44 | 76 | 12/26/2024 |
1.0.43 | 73 | 12/26/2024 |
1.0.42 | 77 | 12/26/2024 |
1.0.41 | 90 | 12/26/2024 |
1.0.40 | 76 | 12/26/2024 |
1.0.39 | 79 | 12/25/2024 |
1.0.38 | 233 | 12/23/2024 |
1.0.37 | 238 | 12/23/2024 |
1.0.36 | 72 | 12/23/2024 |
1.0.35 | 91 | 12/23/2024 |
1.0.34 | 294 | 12/19/2024 |
1.0.33 | 226 | 12/16/2024 |
1.0.32 | 318 | 12/6/2024 |
1.0.31 | 247 | 12/5/2024 |
1.0.30 | 125 | 12/4/2024 |
1.0.29 | 229 | 12/2/2024 |
1.0.28 | 97 | 12/2/2024 |
1.0.27 | 117 | 12/2/2024 |
1.0.26 | 159 | 12/1/2024 |
1.0.25 | 158 | 12/1/2024 |
1.0.24 | 129 | 11/30/2024 |
1.0.23 | 93 | 11/29/2024 |
1.0.22 | 182 | 11/27/2024 |
1.0.21 | 153 | 11/26/2024 |
1.0.20 | 167 | 11/20/2024 |
1.0.19 | 286 | 11/15/2024 |
1.0.18 | 163 | 11/14/2024 |
1.0.17 | 141 | 11/13/2024 |
1.0.16 | 397 | 11/4/2024 |
1.0.15 | 152 | 11/1/2024 |
1.0.14 | 574 | 10/17/2024 |
1.0.13 | 379 | 10/7/2024 |
1.0.12 | 132 | 10/4/2024 |
1.0.11 | 301 | 9/23/2024 |
1.0.10 | 127 | 9/20/2024 |
1.0.10-pre.1 | 38 | 12/27/2024 |
1.0.9 | 138 | 9/19/2024 |
1.0.8 | 139 | 9/19/2024 |
1.0.7 | 85 | 9/19/2024 |
1.0.6 | 125 | 9/19/2024 |
1.0.5 | 99 | 9/18/2024 |
1.0.4 | 100 | 9/18/2024 |
1.0.3 | 214 | 9/18/2024 |
1.0.2 | 141 | 9/18/2024 |
1.0.1 | 209 | 9/14/2024 |
1.0.0 | 108 | 9/14/2024 |
##