示例#1
0
        public async Task <ActionResult> DeletePost(int id)
        {
            var post = await _services.GetPost(id);

            if (post == null)
            {
                return(NotFound());
            }
            await _services.DeletePost(post);

            _services.DeleteImage(post.imageName);
            return(Redirect("/"));
        }