コード例 #1
0
        public async Task <IActionResult> Edit(Guid id, WebUrlViewModel webUrlViewModel)
        {
            if (ModelState.IsValid)
            {
                var url = _webUrlService.GetWebUrl(webUrlViewModel.Url);
                if (url != null)
                {
                    if (url.Id != id)
                    {
                        return(RedirectToAction("Edit", new { message = URLShortener.Core.Resource.Resource_Fa.ThisFaNameIsAllready }));
                    }
                }

                _webUrlService.Edit(webUrlViewModel);
                return(RedirectToAction(nameof(Index)));
            }
            return(View(webUrlViewModel));
        }