コード例 #1
0
ファイル: ApiResponse.g.cs プロジェクト: daniefer/samples
 public void AddPosts(ApiPostsResponseModel item)
 {
     if (!this.Posts.Any(x => x.Id == item.Id))
     {
         this.Posts.Add(item);
     }
 }
コード例 #2
0
        public virtual ApiPostsResponseModel MapRequestToResponse(
            int id,
            ApiPostsRequestModel request)
        {
            var response = new ApiPostsResponseModel();

            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.Tags,
                                   request.Title,
                                   request.ViewCount);
            return(response);
        }