public ActionResult RemoveFileFromPost(Post post, File file, string returnUri) { bool removedFile = blogsFileService.RemoveFile(post, file); if (!string.IsNullOrEmpty(returnUri)) { return(Redirect(returnUri)); } return(new JsonResult { Data = removedFile }); }
public ActionResult RemoveFileFromPost(PostAddress postAddress, FileAddress fileAddress, string returnUri) { Post post = postService.GetPost(postAddress); if (post == null) { return(null); } File file = fileService.GetFile(post, fileAddress); if (file == null) { return(null); } bool removedFile = fileService.RemoveFile(post, file); return(!string.IsNullOrEmpty(returnUri) ? (ActionResult)Redirect(returnUri) : new JsonResult { Data = removedFile }); }