public IActionResult AddWord(WordManipulationViewModel input) { if (wordManipulator.AddWord(input.Word, HttpContext.Connection.LocalIpAddress.MapToIPv4().ToString())) { return(RedirectToAction("ManipulateWordResult", new { message = $"Word '{input.Word}' added succesfully" })); } else { return(RedirectToAction("ManipulateWordResult", new { message = $"Could not add word '{input.Word}'" })); } }
public void Post([FromBody] string value) { string ip = HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString(); wordsManipulationService.AddWord(value, ip); }