ktsu.ToStringJsonConverter
1.0.43
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ktsu.ToStringJsonConverter --version 1.0.43
NuGet\Install-Package ktsu.ToStringJsonConverter -Version 1.0.43
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.43" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.ToStringJsonConverter --version 1.0.43
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ktsu.ToStringJsonConverter, 1.0.43"
#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.43 // Install ktsu.ToStringJsonConverter as a Cake Tool #tool nuget:?package=ktsu.ToStringJsonConverter&version=1.0.43
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 (3)
Showing the top 3 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 |
|
ktsu.Schema
Schema |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.48 | 728 | a month ago |
1.0.48-pre.23 | 0 | a day ago |
1.0.48-pre.22 | 27 | 3 days ago |
1.0.48-pre.21 | 27 | 5 days ago |
1.0.48-pre.20 | 31 | 7 days ago |
1.0.48-pre.19 | 7 | 9 days ago |
1.0.48-pre.18 | 25 | 10 days ago |
1.0.48-pre.17 | 29 | 12 days ago |
1.0.48-pre.16 | 20 | 14 days ago |
1.0.48-pre.15 | 27 | 14 days ago |
1.0.48-pre.14 | 8 | 15 days ago |
1.0.48-pre.13 | 42 | 17 days ago |
1.0.48-pre.12 | 45 | 19 days ago |
1.0.48-pre.11 | 64 | 21 days ago |
1.0.48-pre.10 | 47 | 21 days ago |
1.0.48-pre.9 | 47 | 21 days ago |
1.0.48-pre.8 | 46 | 21 days ago |
1.0.48-pre.7 | 46 | 22 days ago |
1.0.48-pre.6 | 68 | 24 days ago |
1.0.48-pre.5 | 46 | 25 days ago |
1.0.48-pre.4 | 45 | a month ago |
1.0.48-pre.3 | 41 | a month ago |
1.0.48-pre.2 | 43 | a month ago |
1.0.48-pre.1 | 44 | a month ago |
1.0.47-pre.1 | 40 | a month ago |
1.0.46 | 266 | a month ago |
1.0.45 | 81 | a month ago |
1.0.44 | 80 | a month ago |
1.0.43 | 77 | a month ago |
1.0.42 | 81 | a month ago |
1.0.41 | 94 | a month ago |
1.0.40 | 80 | a month ago |
1.0.39 | 83 | a month ago |
1.0.38 | 237 | a month ago |
1.0.37 | 244 | a month ago |
1.0.36 | 78 | a month ago |
1.0.35 | 99 | a month ago |
1.0.34 | 298 | a month ago |
1.0.33 | 230 | a month ago |
1.0.32 | 320 | 2 months ago |
1.0.31 | 251 | 2 months ago |
1.0.30 | 127 | 2 months ago |
1.0.29 | 233 | 2 months ago |
1.0.28 | 101 | 2 months ago |
1.0.27 | 119 | 2 months ago |
1.0.26 | 161 | 2 months ago |
1.0.25 | 162 | 2 months ago |
1.0.24 | 133 | 2 months ago |
1.0.23 | 95 | 2 months ago |
1.0.22 | 184 | 2 months ago |
1.0.21 | 155 | 2 months ago |
1.0.20 | 169 | 2 months ago |
1.0.19 | 295 | 2 months ago |
1.0.18 | 169 | 2 months ago |
1.0.17 | 149 | 2 months ago |
1.0.16 | 401 | 3 months ago |
1.0.15 | 156 | 3 months ago |
1.0.14 | 576 | 3 months ago |
1.0.13 | 383 | 4 months ago |
1.0.12 | 134 | 4 months ago |
1.0.11 | 303 | 4 months ago |
1.0.10 | 129 | 4 months ago |
1.0.10-pre.1 | 42 | a month ago |
1.0.9 | 143 | 4 months ago |
1.0.8 | 141 | 4 months ago |
1.0.7 | 87 | 4 months ago |
1.0.6 | 127 | 4 months ago |
1.0.5 | 101 | 4 months ago |
1.0.4 | 102 | 4 months ago |
1.0.3 | 218 | 4 months ago |
1.0.2 | 143 | 4 months ago |
1.0.1 | 209 | 4 months ago |
1.0.0 | 110 | 4 months ago |