/// <summary> /// Inserts the specified entity. /// </summary> /// <param name="thesaurusWordObject">The thesaurusWord object</param> public void Insert(ThesaurusWord thesaurusWordObject) { if (!_wordCache.ContainsKey(thesaurusWordObject.GetKey())) { _wordCache.Add(thesaurusWordObject.GetKey(), thesaurusWordObject); _wordStore.Insert(thesaurusWordObject); // _wordStore.Save("thesaurus.json"); } }
/// <summary> /// Inserts the specified thesaurus word /// </summary> /// <param name="thesaurusWord">The thesaurus word</param> public void Insert(ThesaurusWord thesaurusWord) { if (thesaurusWord == null) { return; } if (!_thesaurusWordsDictionary.ContainsKey(thesaurusWord.GetKey())) { _thesaurusWordsDictionary.Add(thesaurusWord.GetKey(), thesaurusWord); } else { _thesaurusWordsDictionary[thesaurusWord.GetKey()] = thesaurusWord; } }
/// <summary> /// Deletes the specified entity. /// </summary> /// <param name="thesaurusWordObject">The thesaurusWord Object</param> public void Delete(ThesaurusWord thesaurusWordObject) { _wordCache.Remove(thesaurusWordObject.GetKey()); _wordStore.Delete(thesaurusWordObject); }