示例#1
0
 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}'" }));
     }
 }
示例#2
0
        public void Post([FromBody] string value)
        {
            string ip = HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString();

            wordsManipulationService.AddWord(value, ip);
        }