Пример #1
0
        public static Dictionary <string, int> GetTopicSendersWithSentValues(string Topic, IGraphConfiguration GraphConfiguration)
        {
            Dictionary <string, int> tagSenders = new Dictionary <string, int>();

            using (var tagHiveClient = CommunicationProcessingBusinessLogic.CreateGremlinClient(GraphConfiguration))
            {
                string query   = GraphQueryBusinessLogic.GetTopicSendersGraphQueryWithSentValues(Topic);
                var    results = CommunicationProcessingBusinessLogic.SubmitRequest(tagHiveClient, query).Result;
                if (results.Count > 0)
                {
                    foreach (var resultsetItem in results)
                    {
                        foreach (var item in resultsetItem)
                        {
                            tagSenders.Add(((KeyValuePair <string, object>)item).Key, int.Parse(((KeyValuePair <string, object>)item).Value.ToString()));
                        }
                    }
                }
            }

            return(tagSenders);
        }