Пример #1
0
        public void AddWord(string input)
        {
            Words word = new Words();

            word.Word = input;

            _em.Words.Add(word);
            _em.SaveChanges();
        }
Пример #2
0
        public void Log(string requestWord, string userIp)
        {
            UserLog userLog = new UserLog();

            userLog.RequestWord = requestWord;
            userLog.UserIp      = userIp;
            userLog.RequestDate = DateTime.Now;

            _em.UserLog.Add(userLog);
            _em.SaveChanges();
        }
Пример #3
0
        public void SetCachedAnagrams(List <string> anagrams, string requestWord)
        {
            Words word = new Words();

            foreach (string anagram in anagrams)
            {
                CachedWords cachedWord = new CachedWords();
                cachedWord.RequestWord  = requestWord;
                cachedWord.ResponseWord = _em.Words.Where(w => w.Word == anagram).Single().Id;
                _em.CachedWords.Add(cachedWord);
            }

            _em.SaveChanges();
        }