示例#1
0
 public void AddPost(ApiPostResponseModel item)
 {
     if (!this.Posts.Any(x => x.Id == item.Id))
     {
         this.Posts.Add(item);
     }
 }
示例#2
0
        public virtual ApiPostResponseModel MapRequestToResponse(
            int id,
            ApiPostRequestModel request)
        {
            var response = new ApiPostResponseModel();

            response.SetProperties(id,
                                   request.AcceptedAnswerId,
                                   request.AnswerCount,
                                   request.Body,
                                   request.ClosedDate,
                                   request.CommentCount,
                                   request.CommunityOwnedDate,
                                   request.CreationDate,
                                   request.FavoriteCount,
                                   request.LastActivityDate,
                                   request.LastEditDate,
                                   request.LastEditorDisplayName,
                                   request.LastEditorUserId,
                                   request.OwnerUserId,
                                   request.ParentId,
                                   request.PostTypeId,
                                   request.Score,
                                   request.Tag,
                                   request.Title,
                                   request.ViewCount);
            return(response);
        }