Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
 private void DeleteRelatedWords(Dictionary dictionary)
 {
     foreach (var word in GetRelatedWords(dictionary))
     {
         wordRepository.Delete(word);
     }
 }
Ejemplo n.º 3
0
 public void DeleteWords(int[] wordIdList)
 {
     foreach (var id in wordIdList)
     {
         wordRepository.Delete(id);
     }
 }
Ejemplo n.º 4
0
 public string Delete(int id)
 {
     if (!id.Validate())
     {
         throw new Exception("Invalid model");
     }
     return(rep.Delete(id) > 0
             ? "Delete completed successful"
             : null);
 }
Ejemplo n.º 5
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!UserHelper.GetCurrent().IsAdmin)
            {
                return(View("AccesoDenegdo"));
            }
            _wordRepository.Delete(_wordRepository.GetById(id));

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 6
0
        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());
     }
 }
Ejemplo n.º 9
0
        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());
        }
Ejemplo n.º 10
0
        public ActionResult Delete(int id)
        {
            var word = _wordReposirory.Get(id);

            if (word == null)
            {
                return(NotFound());
            }

            _wordReposirory.Delete(id);

            return(NoContent());
        }
Ejemplo n.º 11
0
        public async Task <IActionResult> Delete(int id)
        {
            var item = await _repository.FindWordAsync(id);

            if (item == null)
            {
                return(NotFound());
            }

            await _repository.Delete(id);

            return(NoContent());
        }
Ejemplo n.º 12
0
        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();
        }
Ejemplo n.º 13
0
 public void Delete(Word word)
 {
     _wordRepository.Delete(word);
 }
Ejemplo n.º 14
0
 public Task Delete(int categoryId, int id)
 => _repository.Delete(categoryId, id);
 public void Delete(int wordId)
 {
     _repository.Delete(wordId);
     CleanCache();
 }