public void RemoveWordConnection(WordConnectionBase iwc) { var toRemove = db.WordConnections.FirstOrDefault(x => x.Equals(iwc)); if (toRemove != null) { db.WordConnections.Remove((WordConnection)iwc); db.SaveChanges(); } }
private void DisconnectWords() { WordConnectionBase iwc = _dao.CreateWordConnection(); iwc.Language1 = SelectedDictionaryLeft.Language; iwc.Language2 = SelectedDictionaryRight.Language; iwc.Word1 = SelectedWordLeft.Text; iwc.Word2 = SelectedWordRight.Text; _dao.RemoveWordConnection(iwc); _wordConnections = _dao.GetAllWordConnections(); }
public void AddWordConnection(WordConnectionBase iwc) { db.WordConnections.Add((WordConnection)iwc); db.SaveChanges(); }