Exemple #1
0
        public IActionResult Delete(string wordId)
        {
            if (!wordRepository.WordExists(wordId))
            {
                return(NotFound());
            }
            Word word = wordRepository.GetWord(wordId);

            if (!wordRepository.Delete(word))
            {
                ModelState.AddModelError("", "Delete Error");
                return(StatusCode(500));
            }
            return(Ok("Delete Success"));
        }