File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed
ClassLibraries/Macross.Json.Extensions
System.Text.Json.Serialization Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 2020 decorate an enum type with the options to use when serializing/deserializing
2121 its values.
2222
23- * Add ` JsonTypeConverterAdapterFactory ` for using ` TypeConverter ` s with
23+ * Added ` JsonTypeConverterAdapter ` for using ` TypeConverter ` s with
2424 System.Text.Json. ([ #19 ] ( https://github.com/Macross-Software/core/pull/19 ) )
2525
2626## 2.0.0
Original file line number Diff line number Diff line change 1717 System.Text.Json.Serialization.JsonIPAddressConverter
1818 System.Text.Json.Serialization.JsonIPEndPointConverter
1919 System.Text.Json.Serialization.JsonDelegatedStringConverter
20- System.Text.Json.Serialization.JsonTypeConverterAdapterFactory
20+ System.Text.Json.Serialization.JsonTypeConverterAdapter
2121 System.Net.Http.PushStreamContent
2222 </Description >
2323 <Product >Macross.Json.Extensions</Product >
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace System.Text.Json.Serialization
99 /// <summary>
1010 /// <see cref="JsonConverterFactory"/> to convert types to and from strings using <see cref="TypeConverter"/>s. Supports nullable value types.
1111 /// </summary>
12- public class JsonTypeConverterAdapterFactory : JsonConverterFactory
12+ public class JsonTypeConverterAdapter : JsonConverterFactory
1313 {
1414#pragma warning disable CA1062 // Validate arguments of public methods
1515 /// <inheritdoc />
Original file line number Diff line number Diff line change @@ -379,13 +379,13 @@ decoration](https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.ty
379379pattern , much like `JsonConverter `, but it is not supported by the
380380System .Text .Json engine (as of .NET 5).
381381
382- The `JsonTypeConverterAdapterFactory ` is provided to add support for using a
382+ The `JsonTypeConverterAdapter ` is provided to add support for using a
383383`TypeConverter ` to [de ]serialize a given type through System .Text .Json . Note :
384- The `TypeConverter ` being used must support `string ` as a to destination & from
385- source .
384+ The `TypeConverter ` being used must support `string ` as a " to " destination &
385+ " from " source .
386386
387387```csharp
388- [JsonConverter (typeof (JsonTypeConverterAdapterFactory ))]
388+ [JsonConverter (typeof (JsonTypeConverterAdapter ))]
389389[TypeConverter (typeof (MyCustomTypeConverter ))]
390390public class MyClass
391391{
Original file line number Diff line number Diff line change 1111namespace Macross . Json . Extensions . Tests
1212{
1313 [ TestClass ]
14- public class JsonTypeConverterAdapterFactoryTests
14+ public class JsonTypeConverterAdapterTests
1515 {
1616 [ TestMethod ]
17- public void TypeConverterTest ( )
17+ public void SerializeAndDeserializeTest ( )
1818 {
1919 JsonSerializerOptions options = new JsonSerializerOptions ( ) ;
20- options . Converters . Add ( new JsonTypeConverterAdapterFactory ( ) ) ;
20+ options . Converters . Add ( new JsonTypeConverterAdapter ( ) ) ;
2121
2222 TestClass testObj = new TestClass ( )
2323 {
@@ -72,7 +72,7 @@ public void TypeConverterTest()
7272 public void InvalidReferenceValueTest ( Type typeToConvert )
7373 {
7474 JsonSerializerOptions options = new JsonSerializerOptions ( ) ;
75- options . Converters . Add ( new JsonTypeConverterAdapterFactory ( ) ) ;
75+ options . Converters . Add ( new JsonTypeConverterAdapter ( ) ) ;
7676
7777 JsonSerializer . Deserialize ( "1234" , typeToConvert , options ) ;
7878 }
@@ -89,7 +89,7 @@ private class TestClass
8989 }
9090
9191 [ TypeConverter ( typeof ( ReferenceTypeConverter ) ) ]
92- [ JsonConverter ( typeof ( JsonTypeConverterAdapterFactory ) ) ]
92+ [ JsonConverter ( typeof ( JsonTypeConverterAdapter ) ) ]
9393 private record ReferenceTest
9494 {
9595 public int X { get ; set ; }
You can’t perform that action at this time.
0 commit comments