public ScoredPostDto FromScoredPostToScoredPostDto(ScoredPost scoredPost) { ScoredPostDto scoredPostDto = new ScoredPostDto() { UserId = scoredPost.UserId, PostId = scoredPost.PostId }; if (scoredPost.Score) { scoredPostDto.Type = ScoreTypes.Positive; } else { scoredPostDto.Type = ScoreTypes.Negative; } return(scoredPostDto); }
public ScoredPost FromScoredPostDtoToScoredPost(ScoredPostDto scoredPostDto) { ScoredPost scoredPost = new ScoredPost() { PostId = scoredPostDto.PostId, UserId = scoredPostDto.UserId }; switch (scoredPostDto.Type) { case ScoreTypes.Positive: scoredPost.Score = true; break; case ScoreTypes.Negative: scoredPost.Score = false; break; } return(scoredPost); }
private void AddScoredPost(int postId, int userId, ScoreTypes type) { ScoredPost scoredPost = new ScoredPost() { PostId = postId, UserId = userId }; switch (type) { case ScoreTypes.Positive: scoredPost.Score = true; break; case ScoreTypes.Negative: scoredPost.Score = false; break; } postManager.AddScoredPost(scoredPost); }