public void WordRepositoryTest_Words_Delete_validModel() { var model = new Word { WordId = 1, Category = "Category", Original = "Original", Translate = "Translate", Transcription = "Transcription" }; var result = rep.Delete(model.WordId); Assert.AreEqual(model.WordId, result, string.Format("result != expected")); }
private void DeleteRelatedWords(Dictionary dictionary) { foreach (var word in GetRelatedWords(dictionary)) { wordRepository.Delete(word); } }
public void DeleteWords(int[] wordIdList) { foreach (var id in wordIdList) { wordRepository.Delete(id); } }
public string Delete(int id) { if (!id.Validate()) { throw new Exception("Invalid model"); } return(rep.Delete(id) > 0 ? "Delete completed successful" : null); }
public ActionResult DeleteConfirmed(Guid id) { if (!UserHelper.GetCurrent().IsAdmin) { return(View("AccesoDenegdo")); } _wordRepository.Delete(_wordRepository.GetById(id)); return(RedirectToAction("Index")); }
private void btnDeleteWord_Click(object sender, EventArgs e) { var selectedWord = wordBindingSource.Current as Word; if (selectedWord != null) { _wordRepository.Delete(selectedWord.ID); LoadWords(); MessageBox.Show("Kelime Silindi."); } }
public IActionResult Delete(int id) { var obj = _repository.GetOne(id); if (obj == null) { return(StatusCode(404)); } _repository.Delete(id); return(StatusCode(204)); }
public IActionResult Delete(int id) { try { _repository.Delete(id); return(Ok()); } catch (WordNotFoundException) { return(NotFound()); } }
public async Task <ActionResult> Delete(string id) { var wordToDelete = await _wordRepository.Get(id); if (wordToDelete == null) { return(NotFound()); } await _wordRepository.Delete(wordToDelete.Id); return(NoContent()); }
public ActionResult Delete(int id) { var word = _wordReposirory.Get(id); if (word == null) { return(NotFound()); } _wordReposirory.Delete(id); return(NoContent()); }
public async Task <IActionResult> Delete(int id) { var item = await _repository.FindWordAsync(id); if (item == null) { return(NotFound()); } await _repository.Delete(id); return(NoContent()); }
public IActionResult Delete(Guid id) { _log.LogInformation($"Delete word {id}"); var word = _wordRepository.Get(id, UserId); if (word == null) { _log.LogWarning($"Word with id {id} not found. User: {UserId}"); return NotFound(); } _wordRepository.Delete(word); return Ok(); }
public void Delete(Word word) { _wordRepository.Delete(word); }
public Task Delete(int categoryId, int id) => _repository.Delete(categoryId, id);
public void Delete(int wordId) { _repository.Delete(wordId); CleanCache(); }