コード例 #1
0
        public static void Collect(int issueId, string text, int count, int wordsInText)
        {
            if (_cache == null)
                _cache = new List<Model.Word>();

            var wordItem = new Model.Word() { IssueId = issueId, Text = text, Count = count, WordsInText = wordsInText, Created = DateTime.Now };

            var _cacheItem = _cache.FirstOrDefault(i => i.IssueId == wordItem.IssueId && i.Text == wordItem.Text);
            if (_cacheItem != null)
                _cacheItem.Count += count;
            else
                _cache.Add(wordItem);
        }
コード例 #2
0
        public static void Collect(int issueId, string text, int count, int wordsInText)
        {
            if (_cache == null)
            {
                _cache = new List <Model.Word>();
            }

            var wordItem = new Model.Word()
            {
                IssueId = issueId, Text = text, Count = count, WordsInText = wordsInText, Created = DateTime.Now
            };

            var _cacheItem = _cache.FirstOrDefault(i => i.IssueId == wordItem.IssueId && i.Text == wordItem.Text);

            if (_cacheItem != null)
            {
                _cacheItem.Count += count;
            }
            else
            {
                _cache.Add(wordItem);
            }
        }