예제 #1
0
        public async Task <IActionResult> Add(TagView result)
        {
            if (await _tagService.CheckIfTagExist(result.Name))
            {
                ModelState.AddModelError("", "Tag o tej nazwie już istnieje");
            }

            if (!ModelState.IsValid)
            {
                return(View(result));
            }

            await _tagService.Create(TagHelpers.ConvertToModel(result));

            return(RedirectToAction("List"));
        }