public void AddCacheToRepository(IList <string> list, string word) { var resultList = _anagramCache.GetAnagramIDs(list); if (resultList.Count == 0) //adds to searched word list so userlog can display even if it's not in the dictionary { SearchedWordID(word); } foreach (var item in resultList) { var cachedWords = new CachedWords() { WordID = item, SearchedWordID = SearchedWordID(word) }; _anagramCache.AddCachedWords(cachedWords); } }