protected async Task PublishMessage <T>(string type, T data)
        {
            // That's a very quick and dirty way to handle the json type serialization...
            var jsonData = JsonConvert.SerializeObject(data, new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });
            //var jsonData = JsonConvert.DeserializeObject<JsonDocument>(dataString);

            var pubSubMessage = new PubSubMessage()
            {
                Type = type,
                Data = jsonData
            };

            await PublishMessage(pubSubMessage);
        }
 private async Task PublishMessage(PubSubMessage pubSubMessage)
 {
     await _database.PublishAsync("MESSAGES", JsonConvert.SerializeObject(pubSubMessage));
 }