public IActionResult Post([FromBody] CreateURLRequest value) { if (ModelState.IsValid) { _repository.AddAddress(value.GetURL()); return(Ok()); } return(new NotFoundResult()); }
public IActionResult Create(URL url) { if (ModelState.IsValid) { _URLRepo.AddAddress(url); return(RedirectToAction("Index")); } var URLList = _URLRepo.GetAdresses(); return(View("Index", URLList)); }