public void Save(string text, string word) { wordSearcher.SplitText(text); Dictionary <string, int> amountOfEntry = wordSearcher.GetSentencesWithCurrentWord(word); foreach (var entry in amountOfEntry.Keys) { repository.Create( new SearchWord { Word = word, Amount = amountOfEntry[entry], Sentence = Reverse(entry) } ); } repository.SaveChanges(); }