Example #1
0
        public async Task <IActionResult> Delete(int id, IFormCollection collection)
        {
            try
            {
                var deletedBlogTag = await _blogTagRepository.GetByIdAsync(id);

                await _blogTagRepository.DeleteAsync(deletedBlogTag);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                var notDeletedBlogTag = await _blogTagRepository.GetByIdAsync(id);

                return(View(notDeletedBlogTag));
            }
        }