public void DeleteWords_AllIsOk() { //Act var result = _service.DeleteWord(1); //Assert Assert.IsTrue(result); }
public IActionResult Delete(int wordId) { string ip = HttpContext.Connection.RemoteIpAddress.ToString(); try { _dictionaryService.DeleteWord(wordId, ip); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult Delete(IFormCollection collection) { string ip = HttpContext.Connection.RemoteIpAddress.ToString(); int wordId = Int32.Parse(collection["word"]); try { _dictionaryService.DeleteWord(wordId, ip); } catch (Exception ex) { return(RedirectToAction("Index", new { ErrorMessage = ex.Message })); } return(RedirectToAction("Index")); }
public bool DeleteWordById(int id) { _logger.Info($"[DictionaryController] The dictionary with id {id} was deleted "); return(_dictionaryService.DeleteWord(id)); }