Пример #1
0
 public IActionResult Post([FromBody] CreateURLRequest value)
 {
     if (ModelState.IsValid)
     {
         _repository.AddAddress(value.GetURL());
         return(Ok());
     }
     return(new NotFoundResult());
 }
Пример #2
0
        public IActionResult Create(URL url)
        {
            if (ModelState.IsValid)
            {
                _URLRepo.AddAddress(url);
                return(RedirectToAction("Index"));
            }

            var URLList = _URLRepo.GetAdresses();

            return(View("Index", URLList));
        }