protected void CalculateCommentState(Comment comment, ActiontType type) { if (!this.AvailableStates.ContainsKey(type)) { comment.State = CommentState.Rejected; } comment.State = this.AvailableStates[type]; }
public void CalculateSate(Comment comment, int CurrentUserId, ActiontType type) { switch (type) { case ActiontType.Edit: var authorId = comment.Actions.Where(x => x.Action == ActiontType.Add).FirstOrDefault().UserId; if (CurrentUserId != authorId) { comment.State = CommentState.Rejected; } break; default: this.CalculateCommentState(comment, type); break; } }
public void CalculateState(Comment comment, int currentUserId, ActiontType actionType, AuthorType authorType) { this._commentActionStrategyFactory.GetRequestStateStrategy(authorType).CalculateSate(comment, currentUserId, actionType); }
public void CalculateSate(Comment comment, int CurrentUserId, ActiontType actionType) { this.CalculateCommentState(comment, actionType); }