/// <summary> /// Removes a Tweet entity from the database and breaks all /// relations for 'RepliesFrom' and 'RepliesTo' properties /// </summary> /// <param name="tweetToDelete"></param> /// <returns></returns> public async Task DeleteTweet(Tweet tweetToDelete) { if (tweetToDelete.RepliesTo.Count > 0) { tweetToDelete.RepliesTo.Clear(); } if (tweetToDelete.RepliesFrom.Count > 0) { tweetToDelete.RepliesFrom.Clear(); } _tweetRepository.Delete(tweetToDelete); await _tweetRepository.SaveAsync(); }
public bool DeleteTweet(string tweetId) { bool isDeleted = false; try { isDeleted = _tweetRepository.Delete(tweetId); } catch (Exception ex) { string msg = ex.Message; isDeleted = false; } return(isDeleted); }
public void Delete(DeleteTweet request) => _tweetRepo.Delete(request.Id);
public void Delete(int id) { repository.Delete(id); }