コード例 #1
0
        public async Task <IActionResult> Delete(int Id)
        {
            var article = await _articleService.Get(Id);

            // Usuwamy zdjęcie przypisane do artykułu
            if (article.Image != null)
            {
                _cloudService.DeleteFile(article.Image.Id);
            }

            // Usuwamy taxonomies artykułu
            if (article.Taxonomies.Count != 0)
            {
                await _taxonomyService.Delete(Id);
            }

            // Usuwamy artykuł
            await _articleService.Delete(Id);

            return(RedirectToAction("List"));
        }