Beispiel #1
0
        public async Task <IActionResult> Create(BlogTag newBlogTag, IFormCollection collection)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(newBlogTag));
                }
                await _blogTagRepository.AddAsync(newBlogTag);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(View(newBlogTag));
        }