public async Task <bool> DeletePost(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException(nameof(id), "Id cannot be null."); } return(await _repository.DeletePost(id)); }
public bool DeletePost(string key, string postid, string username, string password, bool publish) { EnsureUser(username, password).Wait(); try { var result = _repo.DeletePost(postid); _repo.SaveAll(); return(true); } catch (Exception) { return(false); } }
public IActionResult PostsDelete([FromBody] List <PostItem> items) { if (items == null || items.Count == 0) { return(NotFound()); } foreach (var item in items) { if (item.IsChecked) { _postsRepository.DeletePost(item.Id); } } _postsRepository.SaveAll(); return(Ok()); }
public async void Delete_ShouldPass(string id) { var delete = await _repository.DeletePost(id); Assert.True(delete); }
public void DeletePost(int id) { repository.DeletePost(id); }
public async Task DeletePost(int postId) { await _commentsRepository.DeletePostComments(postId); await _postsRepository.DeletePost(postId); }
public async Task <IActionResult> DeletePost(Guid postId) { var post = await _repo.DeletePost(postId); return(Ok(post)); }
public async Task DeletePost(long postId) { await _postsRepository.DeletePost(postId); }