예제 #1
0
        private async Task <BlogEntryPhoto> DeleteBlogPhoto(int blogEntryPhotoId)
        {
            var entry = _blogEntryPhotoRepository.Get(blogEntryPhotoId);

            await _siteFilesRepository.DeleteFileAsync(entry.PhotoUrl);

            await _siteFilesRepository.DeleteFileAsync(entry.PhotoThumbUrl);

            await _siteFilesRepository.DeleteFileAsync(entry.PhotoFullScreenUrl);

            await _siteFilesRepository.DeleteFileAsync(entry.PhotoPreviewUrl);

            _blogEntryPhotoRepository.Delete(blogEntryPhotoId);

            return(entry);
        }
        public async Task <ActionResult> DeleteFileAsync(string fileUrl)
        {
            await _siteFilesRepository.DeleteFileAsync(fileUrl);

            return(RedirectToAction("Index"));
        }