Semantica.Lib.Core.Json.Newtonsoft
8.1.0
dotnet add package Semantica.Lib.Core.Json.Newtonsoft --version 8.1.0
NuGet\Install-Package Semantica.Lib.Core.Json.Newtonsoft -Version 8.1.0
<PackageReference Include="Semantica.Lib.Core.Json.Newtonsoft" Version="8.1.0" />
<PackageVersion Include="Semantica.Lib.Core.Json.Newtonsoft" Version="8.1.0" />
<PackageReference Include="Semantica.Lib.Core.Json.Newtonsoft" />
paket add Semantica.Lib.Core.Json.Newtonsoft --version 8.1.0
#r "nuget: Semantica.Lib.Core.Json.Newtonsoft, 8.1.0"
#:package Semantica.Lib.Core.Json.Newtonsoft@8.1.0
#addin nuget:?package=Semantica.Lib.Core.Json.Newtonsoft&version=8.1.0
#tool nuget:?package=Semantica.Lib.Core.Json.Newtonsoft&version=8.1.0
Semantica.Lib.Core.Json.Newtonsoft
This package is part of the core packages of Semantica.Lib.
Summary
Provides identical json converter base classes to those provided in the Semantica.Lib.Core.Json namespace, but inheriting from Newtonsoft.Json.JsonConverter rather than the System.Text.Json version.
Dependencies
- Semantica.Lib.Extensions
- Newtonsoft.Json
Documentation generated from the XMLDoc:
<a name='assembly'></a>
Lib.Core.Json.Newtonsoft
Contents
- Base`2
- Boolean`1
- DateOnly`1
- DateTimeOffset`1
- DateTime`1
- Decimal`1
- Double`1
- Guid`1
- Int`1
- JsonConverterBase
- StringJsonConverterBase`1
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Base`2'></a>
Base`2 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Don't use this base class, but use one of the specific type
<a name='M-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Base2-FromUnderlyingType-1-'></a>
FromUnderlyingType(underlyingValue) method
Summary
Implementation of the conversion to T.
Returns
An instance of T.
Parameters
| Name | Type | Description |
|---|---|---|
| underlyingValue | `1 | Value to convert. |
<a name='M-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Base`2-GetDefault'></a>
GetDefault() method
Summary
Returns default(T?) (null). Override if a different value to should be returned when reading of
the underlying type value fails.
Parameters
This method has no parameters.
<a name='M-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Base2-ToUnderlyingType-0-'></a>
ToUnderlyingType(value) method
Summary
Implementation of the conversion of T to the underlying type.
Returns
A representation of the input as Nullable`1 of the underlying type.
Parameters
| Name | Type | Description |
|---|---|---|
| value | `0 | Value of T to convert. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Boolean`1'></a>
Boolean`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a Boolean.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to boolean. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-DateOnly`1'></a>
DateOnly`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a DateOnly.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to dateonly. |
Remarks
DateOnly is currently not supported by Newtonsoft.Json, so an extra conversion to and from DateTime is used.
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-DateTimeOffset`1'></a>
DateTimeOffset`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a DateTimeOffset.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to datetime offset. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-DateTime`1'></a>
DateTime`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a DateTime.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to datetime. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Decimal`1'></a>
Decimal`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a Decimal`1.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to decimal. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Double`1'></a>
Double`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a Double.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to double. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Guid`1'></a>
Guid`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a Guid.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to guid. |
Remarks
Guid is currently not supported by Newtonsoft.Json, so an extra conversion to and from Guid is used.
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase-Int`1'></a>
Int`1 type
Namespace
Semantica.Core.Json.Newtonsoft.JsonConverterBase
Summary
Use for value types that can be represented as a Int32.
Generic Types
| Name | Description |
|---|---|
| T | The type to convert from or to int. |
<a name='T-Semantica-Core-Json-Newtonsoft-JsonConverterBase'></a>
JsonConverterBase type
Namespace
Semantica.Core.Json.Newtonsoft
Summary
Provides base JsonConverter classes for value types that hold a single underlying value (struct) type that is
supported by System.Text.Json.
Remarks
For conversions from the underlying type, override GetDefault if a value
different to default(T?) (null) should be returned when reading of the underlying type fails.
<a name='T-Semantica-Core-Json-Newtonsoft-StringJsonConverterBase`1'></a>
StringJsonConverterBase`1 type
Namespace
Semantica.Core.Json.Newtonsoft
Summary
Base class that inherits from JsonConverter`1, meant for conversions of T from and to
string. Only FromString and ToString abstract methods need to be implemented.
For conversions from string, override GetDefault if a value different to default(T) should be returned on a
null value, or override UseDefaultOnNull to return false if
null values should be handled by FromString. When not overriden, FromString
will never be called with null.
Generic Types
| Name | Description |
|---|---|
| T | Type to convert to and from String. |
<a name='P-Semantica-Core-Json-Newtonsoft-StringJsonConverterBase`1-UseDefaultOnNull'></a>
UseDefaultOnNull property
Summary
When true, the output of GetDefault is returned on a string input of
null. Override and return false if null values should be handled
by FromString.
<a name='M-Semantica-Core-Json-Newtonsoft-StringJsonConverterBase`1-FromString-System-String-'></a>
FromString(str) method
Summary
Implementation of the conversion to T.
Returns
An instance of T.
Parameters
| Name | Type | Description |
|---|---|---|
| str | System.String | String value to convert. Never null unless UseDefaultOnNull is overriden and returns |
false. |
<a name='M-Semantica-Core-Json-Newtonsoft-StringJsonConverterBase`1-GetDefault'></a>
GetDefault() method
Summary
Returns default(T). Override if a different value to should be returned on a null value.
Parameters
This method has no parameters.
<a name='M-Semantica-Core-Json-Newtonsoft-StringJsonConverterBase1-ToString-0-'></a>
ToString(value) method
Summary
Implementation of the conversion of T to string.
Returns
An string representation of the input.
Parameters
| Name | Type | Description |
|---|---|---|
| value | `0 | Value of T to convert. |
| Product | Versions 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. net9.0 was computed. 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. |
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- Semantica.Lib.Extensions (>= 8.1.0)
-
net7.0
- Newtonsoft.Json (>= 13.0.1)
- Semantica.Lib.Extensions (>= 8.1.0)
-
net8.0
- Newtonsoft.Json (>= 13.0.1)
- Semantica.Lib.Extensions (>= 8.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.1.0 | 176 | 5/30/2025 |
| 8.0.7 | 187 | 9/6/2024 |
| 8.0.6-beta | 159 | 7/10/2024 |
| 8.0.5-beta | 159 | 7/4/2024 |
| 8.0.4-beta | 147 | 7/2/2024 |
| 8.0.3-beta | 157 | 6/14/2024 |
| 8.0.2-beta | 153 | 6/4/2024 |
| 8.0.1-beta | 148 | 6/4/2024 |
| 8.0.0-beta | 151 | 6/4/2024 |
| 6.6.1-beta | 157 | 4/5/2024 |
| 6.6.0-beta | 145 | 3/5/2024 |
| 6.5.5-alpha2 | 151 | 3/4/2024 |
| 6.5.5-alpha | 198 | 3/4/2024 |
| 6.5.4-beta | 165 | 2/29/2024 |
| 6.5.3-beta | 179 | 10/5/2023 |
| 6.5.2-beta | 164 | 10/5/2023 |
| 6.5.1-beta | 178 | 9/29/2023 |
| 6.5.0-beta | 169 | 9/22/2023 |
| 6.4.0-beta | 213 | 7/11/2023 |