ktsu.ToStringJsonConverter
1.2.1
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.ToStringJsonConverter --version 1.2.1
NuGet\Install-Package ktsu.ToStringJsonConverter -Version 1.2.1
<PackageReference Include="ktsu.ToStringJsonConverter" Version="1.2.1" />
<PackageVersion Include="ktsu.ToStringJsonConverter" Version="1.2.1" />
<PackageReference Include="ktsu.ToStringJsonConverter" />
paket add ktsu.ToStringJsonConverter --version 1.2.1
#r "nuget: ktsu.ToStringJsonConverter, 1.2.1"
#:package ktsu.ToStringJsonConverter@1.2.1
#addin nuget:?package=ktsu.ToStringJsonConverter&version=1.2.1
#tool nuget:?package=ktsu.ToStringJsonConverter&version=1.2.1
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. 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. |
-
net8.0
- ktsu.Extensions (>= 1.5.0)
-
net9.0
- ktsu.Extensions (>= 1.5.0)
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.Schema
Schema |
|
ktsu.PkmnDB
PkmnDB |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.2.4 | 274 | 5/21/2025 |
1.2.4-pre.17 | 120 | 5/20/2025 |
1.2.4-pre.15 | 79 | 5/17/2025 |
1.2.4-pre.14 | 141 | 5/16/2025 |
1.2.4-pre.13 | 213 | 5/15/2025 |
1.2.4-pre.12 | 215 | 5/14/2025 |
1.2.4-pre.11 | 208 | 5/13/2025 |
1.2.4-pre.10 | 242 | 5/12/2025 |
1.2.4-pre.9 | 171 | 5/11/2025 |
1.2.4-pre.8 | 113 | 5/10/2025 |
1.2.4-pre.7 | 55 | 5/9/2025 |
1.2.4-pre.6 | 131 | 5/8/2025 |
1.2.4-pre.5 | 127 | 5/7/2025 |
1.2.4-pre.4 | 132 | 5/6/2025 |
1.2.4-pre.3 | 121 | 5/5/2025 |
1.2.4-pre.2 | 132 | 5/4/2025 |
1.2.4-pre.1 | 124 | 5/4/2025 |
1.2.3 | 2,889 | 5/4/2025 |
1.2.3-pre.1 | 55 | 4/26/2025 |
1.2.2 | 592 | 4/25/2025 |
1.2.2-pre.1 | 130 | 4/4/2025 |
1.2.1 | 705 | 3/30/2025 |
1.2.0 | 388 | 3/30/2025 |
1.1.1-pre.3 | 86 | 3/29/2025 |
1.1.1-pre.2 | 468 | 3/25/2025 |
1.1.1-pre.1 | 82 | 2/18/2025 |
1.1.0 | 968 | 2/17/2025 |
1.0.49-pre.3 | 89 | 2/6/2025 |
1.0.49-pre.2 | 77 | 2/5/2025 |
1.0.49-pre.1 | 75 | 2/5/2025 |
1.0.48 | 2,490 | 12/27/2024 |
1.0.48-pre.30 | 77 | 2/4/2025 |
1.0.48-pre.29 | 73 | 2/3/2025 |
1.0.48-pre.28 | 82 | 2/1/2025 |
1.0.48-pre.27 | 74 | 1/30/2025 |
1.0.48-pre.26 | 73 | 1/28/2025 |
1.0.48-pre.25 | 70 | 1/26/2025 |
1.0.48-pre.24 | 73 | 1/24/2025 |
1.0.48-pre.23 | 76 | 1/22/2025 |
1.0.48-pre.22 | 70 | 1/20/2025 |
1.0.48-pre.21 | 65 | 1/18/2025 |
1.0.48-pre.20 | 62 | 1/16/2025 |
1.0.48-pre.19 | 56 | 1/14/2025 |
1.0.48-pre.18 | 64 | 1/13/2025 |
1.0.48-pre.17 | 72 | 1/11/2025 |
1.0.48-pre.16 | 69 | 1/10/2025 |
1.0.48-pre.15 | 70 | 1/10/2025 |
1.0.48-pre.14 | 60 | 1/8/2025 |
1.0.48-pre.13 | 77 | 1/7/2025 |
1.0.48-pre.12 | 79 | 1/5/2025 |
1.0.48-pre.11 | 100 | 1/3/2025 |
1.0.48-pre.10 | 74 | 1/3/2025 |
1.0.48-pre.9 | 79 | 1/3/2025 |
1.0.48-pre.8 | 82 | 1/3/2025 |
1.0.48-pre.7 | 72 | 1/2/2025 |
1.0.48-pre.6 | 100 | 12/31/2024 |
1.0.48-pre.5 | 77 | 12/30/2024 |
1.0.48-pre.4 | 80 | 12/29/2024 |
1.0.48-pre.3 | 67 | 12/28/2024 |
1.0.48-pre.2 | 70 | 12/27/2024 |
1.0.48-pre.1 | 71 | 12/27/2024 |
1.0.47-pre.1 | 78 | 12/27/2024 |
1.0.46 | 295 | 12/26/2024 |
1.0.45 | 112 | 12/26/2024 |
1.0.44 | 103 | 12/26/2024 |
1.0.43 | 100 | 12/26/2024 |
1.0.42 | 110 | 12/26/2024 |
1.0.41 | 124 | 12/26/2024 |
1.0.40 | 102 | 12/26/2024 |
1.0.39 | 110 | 12/25/2024 |
1.0.38 | 259 | 12/23/2024 |
1.0.37 | 266 | 12/23/2024 |
1.0.36 | 100 | 12/23/2024 |
1.0.35 | 135 | 12/23/2024 |
1.0.34 | 330 | 12/19/2024 |
1.0.33 | 250 | 12/16/2024 |
1.0.32 | 340 | 12/6/2024 |
1.0.31 | 281 | 12/5/2024 |
1.0.30 | 159 | 12/4/2024 |
1.0.29 | 260 | 12/2/2024 |
1.0.28 | 124 | 12/2/2024 |
1.0.27 | 147 | 12/2/2024 |
1.0.26 | 190 | 12/1/2024 |
1.0.25 | 190 | 12/1/2024 |
1.0.24 | 161 | 11/30/2024 |
1.0.23 | 125 | 11/29/2024 |
1.0.22 | 210 | 11/27/2024 |
1.0.21 | 184 | 11/26/2024 |
1.0.20 | 202 | 11/20/2024 |
1.0.19 | 319 | 11/15/2024 |
1.0.18 | 194 | 11/14/2024 |
1.0.17 | 178 | 11/13/2024 |
1.0.16 | 427 | 11/4/2024 |
1.0.15 | 187 | 11/1/2024 |
1.0.14 | 599 | 10/17/2024 |
1.0.13 | 406 | 10/7/2024 |
1.0.12 | 164 | 10/4/2024 |
1.0.11 | 326 | 9/23/2024 |
1.0.10 | 148 | 9/20/2024 |
1.0.10-pre.1 | 62 | 12/27/2024 |
1.0.9 | 171 | 9/19/2024 |
1.0.8 | 172 | 9/19/2024 |
1.0.7 | 118 | 9/19/2024 |
1.0.6 | 147 | 9/19/2024 |
1.0.5 | 129 | 9/18/2024 |
1.0.4 | 123 | 9/18/2024 |
1.0.3 | 234 | 9/18/2024 |
1.0.2 | 161 | 9/18/2024 |
1.0.1 | 230 | 9/14/2024 |
1.0.0 | 130 | 9/14/2024 |
## v1.2.1 (patch)
Changes since v1.2.0:
- Update packages ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.2.0 (minor)
Changes since v1.1.0:
- Add LICENSE template ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.1.0 (minor)
Changes since v1.0.0:
- Add mailmap ([@matt-edmondson](https://github.com/matt-edmondson))
- Add null check in TestRoundTrip to prevent null exception ([@matt-edmondson](https://github.com/matt-edmondson))
- Add scripts for automated metadata generation and versioning ([@matt-edmondson](https://github.com/matt-edmondson))
- Apply new editorconfig ([@matt-edmondson](https://github.com/matt-edmondson))
- Migrate ktsu.io to ktsu namespace ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor test method names to camel case ([@matt-edmondson](https://github.com/matt-edmondson))
- Rename package to ktsu.ToStringJsonConverter and update ktsu.Extensions to version 1.0.30 ([@matt-edmondson](https://github.com/matt-edmondson))
- Renamed metadata files ([@matt-edmondson](https://github.com/matt-edmondson))
- Replace LICENSE file with LICENSE.md and update copyright information ([@matt-edmondson](https://github.com/matt-edmondson))
- Update ktsu.Extensions package reference to version 1.0.31 ([@matt-edmondson](https://github.com/matt-edmondson))
- Update LICENSE file to LICENSE.md with copyright notice ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.48 (patch)
Changes since v1.0.48-pre.30:
- Add mailmap ([@matt-edmondson](https://github.com/matt-edmondson))
- Add scripts for automated metadata generation and versioning ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.42 (patch)
Changes since v1.0.41:
- Replace LICENSE file with LICENSE.md and update copyright information ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.40 (patch)
Changes since v1.0.39:
- Refactor test method names to camel case ([@matt-edmondson](https://github.com/matt-edmondson))
- Update LICENSE file to LICENSE.md with copyright notice ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.35 (patch)
Changes since v1.0.34:
- Add null check in TestRoundTrip to prevent null exception ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.26 (patch)
Changes since v1.0.25:
- Update ktsu.Extensions package reference to version 1.0.31 ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.25 (patch)
Changes since v1.0.24:
- Rename package to ktsu.ToStringJsonConverter and update ktsu.Extensions to version 1.0.30 ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.1 (patch)
Changes since v1.0.0:
- Migrate ktsu.io to ktsu namespace ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.0.0 (major)
Changes since 0.0.0.0:
- 1.0.0 ([@matt-edmondson](https://github.com/matt-edmondson))
- Add documentation comments ([@matt-edmondson](https://github.com/matt-edmondson))
- Add project files. ([@matt-edmondson](https://github.com/matt-edmondson))
- Suppress specific warnings in csproj ([@matt-edmondson](https://github.com/matt-edmondson))
- Update Extensions package, and project version ([@matt-edmondson](https://github.com/matt-edmondson))