Пример #1
0
        public static InvokeMessage ToMessage(this string json)
        {
            InvokeMessage message = null;

            var options = new JsonSerializerOptions
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
                WriteIndented        = true
            };

            if (json.IsJson())
            {
                message = JsonSerializer.Deserialize <InvokeMessage>(json, options);
            }

            return(message);
        }
Пример #2
0
 public static string ToJson(this InvokeMessage message)
 {
     return(JsonSerializer.Serialize(message));
 }