77
88namespace Orb ;
99
10- public sealed class ModelConverter < MB > : JsonConverter < MB >
11- where MB : ModelBase , IFromRaw < MB >
10+ public sealed class ModelConverter < TModel > : JsonConverter < TModel >
11+ where TModel : ModelBase , IFromRaw < TModel >
1212{
13- public override MB ? Read (
13+ public override TModel ? Read (
1414 ref Utf8JsonReader reader ,
1515 System ::Type _typeToConvert ,
1616 JsonSerializerOptions options
@@ -22,28 +22,28 @@ JsonSerializerOptions options
2222 if ( properties == null )
2323 return null ;
2424
25- return MB . FromRawUnchecked ( properties ) ;
25+ return TModel . FromRawUnchecked ( properties ) ;
2626 }
2727
28- public override void Write ( Utf8JsonWriter writer , MB value , JsonSerializerOptions options )
28+ public override void Write ( Utf8JsonWriter writer , TModel value , JsonSerializerOptions options )
2929 {
3030 JsonSerializer . Serialize ( writer , value . Properties , options ) ;
3131 }
3232}
3333
34- public sealed class EnumConverter < IE , T > : JsonConverter < IE >
35- where IE : IEnum < IE , T >
34+ public sealed class EnumConverter < TEnum , TValue > : JsonConverter < TEnum >
35+ where TEnum : IEnum < TEnum , TValue >
3636{
37- public override IE Read (
37+ public override TEnum Read (
3838 ref Utf8JsonReader reader ,
3939 System ::Type _typeToConvert ,
4040 JsonSerializerOptions options
4141 )
4242 {
43- return IE . FromRaw ( JsonSerializer . Deserialize < T > ( ref reader , options ) ! ) ;
43+ return TEnum . FromRaw ( JsonSerializer . Deserialize < TValue > ( ref reader , options ) ! ) ;
4444 }
4545
46- public override void Write ( Utf8JsonWriter writer , IE value , JsonSerializerOptions options )
46+ public override void Write ( Utf8JsonWriter writer , TEnum value , JsonSerializerOptions options )
4747 {
4848 JsonSerializer . Serialize ( writer , value . Raw ( ) , options ) ;
4949 }
@@ -89,19 +89,19 @@ public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions
8989 }
9090}
9191
92- public sealed class VariantConverter < IV , T > : JsonConverter < IV >
93- where IV : IVariant < IV , T >
92+ public sealed class VariantConverter < TVariant , TValue > : JsonConverter < TVariant >
93+ where TVariant : IVariant < TVariant , TValue >
9494{
95- public override IV Read (
95+ public override TVariant Read (
9696 ref Utf8JsonReader reader ,
9797 System ::Type _typeToConvert ,
9898 JsonSerializerOptions options
9999 )
100100 {
101- return IV . From ( JsonSerializer . Deserialize < T > ( ref reader , options ) ! ) ;
101+ return TVariant . From ( JsonSerializer . Deserialize < TValue > ( ref reader , options ) ! ) ;
102102 }
103103
104- public override void Write ( Utf8JsonWriter writer , IV value , JsonSerializerOptions options )
104+ public override void Write ( Utf8JsonWriter writer , TVariant value , JsonSerializerOptions options )
105105 {
106106 JsonSerializer . Serialize ( writer , value . Value , options ) ;
107107 }
0 commit comments