コード例 #1
0
        public static VowelConsCountMessage FromJson(string json)
        {
            var obj = new VowelConsCountMessage();

            JsonConvert.PopulateObject(json, obj);
            return(obj);
        }
コード例 #2
0
        public void SendTextScoreTask(string id, int vowelCount, int consCount)
        {
            using (var connection = this._factory.CreateConnection())
                using (var channel = connection.CreateModel())
                {
                    DeclareExchanges(channel);

                    var message = new VowelConsCountMessage();
                    message.ContextId  = id;
                    message.VowelCount = vowelCount;
                    message.ConsCount  = consCount;
                    this.SendMessage(channel, ExchangeTextScoreTask, message.ToJson());
                }
        }