public void ReplaceWord(MasterWord originalWord, MasterWord replacement) { RemoveWord(originalWord); AddWord(replacement); // Apparently doing it only on the book, then saving MasterWord will update everything correctly // replacement.AddBook(this); }
public Word(MasterWord masterWord, string text, Language language, string article = "") { MasterWord = masterWord; Text = text; Language = language; Article = article; masterWord.Words.Add(this); }
public void AddWord(MasterWord word) { if (_BookWordCollection.Any(bw => bw.MasterWordId == word.ID || bw.MasterWord == word)) { return; } _BookWordCollection.Add(new BookWord() { Book = this, BookId = ID, MasterWord = word, MasterWordId = word.ID }); }
public void RemoveWord(MasterWord word) => RemoveWord(word.ID);