public static Dictionary ConvertJObjectToDictionary()

in src/Middleware/Grpc/Server/CtxLogger.cs [117:140]


    public static Dictionary<string, object> ConvertJObjectToDictionary(JObject jObject)
    {
        var result = new Dictionary<string, object>();
        foreach (var property in jObject.Properties())
        {
            if (property.Value is JObject nestedJObject)
            {
                result[property.Name] = ConvertJObjectToDictionary(nestedJObject);
            }
            else if (property.Value is JArray nestedArray)
            {
                result[property.Name] = ConvertJArrayToList(nestedArray);
            }
            else
            {
                var value = property.Value?.ToObject<object>();
                if (value != null)
                {
                    result[property.Name] = value;
                }
            }
        }
        return result;
    }