dotnet / WatsonWebserver

Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
MIT License
403 stars 83 forks source link

Why is the new version no longer supported Statistics.ToJson and Settings.ToJson #100

Closed sqlnew closed 2 years ago

sqlnew commented 2 years ago

In version 4.2.2.13 , WatsonWebserver, there are two very useful functions: statistics.Tojason and settings.tojason, They can easily obtain the internal information of the current service component, but the latest version is in These two functions have disappeared in. Net 6. I don't know why these two functions have been removed. I sincerely hope that these two functions can be added again in the next version. Thank you.

jchristn commented 2 years ago

Hi, I removed them to eliminate the dependency on Newtonsoft.Json. You can serialize them using the built-in serializer (using System.Text.Json) by invoking Server.SerializationHelper.SerializeJson against the statistics and settings objects.