public IActionResult Delete(int Id, string ImagePath) { var result = _blogsRepository.Delete(Id); if (result.Succeed) { _blogGalleryRepository.DeleteByBlogId(Id); } //FileHelper.DeleteFile(ImagePath, _fileConfig, FileType.Image, _environment.WebRootPath); TempData.AddResult(result); return(RedirectToAction(nameof(Index))); }
//DELORT internal Blog Delete(string id) { Blog original = GetById(id); _repo.Delete(id); return(original);; }
public string Delete(int id) { if (_repo.Delete(id)) { return("Deleted!"); } throw new Exception("Failure"); }
internal Blog Delete(int id) { Blog foundBlog = GetById(id); if (_repo.Delete(id)) { return(foundBlog); } throw new Exception("something failed"); }
internal Blog Delete(int id) { Blog foundBlog = GetById(id); if (_repo.Delete(id)) { return(foundBlog); } throw new Exception("Sometihng went wrong with the delete..."); }
public string Delete(int id) { Blog foundBlog = GetById(id); if (_repo.Delete(id)) { return("Great Success, Delorted."); } throw new Exception("Yeah, no, that didnt work."); }
internal Blog Delete(int id) { Blog foundBlog = GetById(id); if (_repo.Delete(id)) { return(foundBlog); } throw new Exception("Something bad happened..."); }
internal void Delete(int id, string creatorId) { Blog blog = GetById(id); if (blog.CreatorId != creatorId) { throw new Exception("You cannot delete another users Blog"); } if (!_repo.Delete(id)) { throw new Exception("Something has gone wrong..."); } ; }
internal Blog Delete(int id, string userId) { Blog found = Get(id); if (found.AuthorId != userId) { throw new Exception("Invalid Request"); } if (_repo.Delete(id)) { return(found); } throw new Exception("Something went terribly wrong"); }
internal string Delete(int id, string userId) { GetById(id); _repo.Delete(id, userId); return("Blog Deleted"); }