1- using System ;
2- using System . ComponentModel ;
31using System . IO ;
42using System . Reflection ;
53using System . Text . Json ;
6- using System . Text . Json . Serialization ;
74using System . Threading . Tasks ;
85using GeneXus . Application ;
96using GeneXus . Cache ;
@@ -39,7 +36,7 @@ static async Task Main()
3936 {
4037
4138 options . JsonSerializerOptions . NumberHandling = System . Text . Json . Serialization . JsonNumberHandling . AllowReadingFromString ;
42- options . JsonSerializerOptions . Converters . Add ( new StringConverter ( ) ) ;
39+ options . JsonSerializerOptions . Converters . Add ( new GeneXus . Utils . StringConverter ( ) ) ;
4340
4441 } ) ;
4542 ISessionService sessionService = GXSessionServiceFactory . GetProvider ( ) ;
@@ -55,28 +52,6 @@ static async Task Main()
5552 GxContext . IsHttpContext = true ;
5653 await host . RunAsync ( ) ;
5754 }
58-
59- public class StringConverter : JsonConverter < string >
60- {
61- public override string Read ( ref Utf8JsonReader reader , Type typeToConvert , JsonSerializerOptions options )
62- {
63- if ( reader . TokenType == JsonTokenType . Number )
64- {
65- if ( reader . TryGetInt32 ( out int l ) )
66- return l . ToString ( ) ;
67- else if ( reader . TryGetDecimal ( out decimal d ) )
68- return d . ToString ( ) ;
69- else
70- return reader . GetDouble ( ) . ToString ( ) ;
71- }
72- return reader . GetString ( ) ;
73- }
74-
75- public override void Write ( Utf8JsonWriter writer , string value , JsonSerializerOptions options )
76- {
77- writer . WriteStringValue ( value ) ;
78- }
79- }
8055 private static string GetRoutePrefix ( string ContentRootPath )
8156 {
8257 //Read host.json file to get Route prefix
0 commit comments