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); }
public static string ToJson(this InvokeMessage message) { return(JsonSerializer.Serialize(message)); }