public virtual ApiRetweetServerResponseModel MapServerRequestToResponse(
            int id,
            ApiRetweetServerRequestModel request)
        {
            var response = new ApiRetweetServerResponseModel();

            response.SetProperties(id,
                                   request.Date,
                                   request.RetwitterUserId,
                                   request.Time,
                                   request.TweetTweetId);
            return(response);
        }
Ejemplo n.º 2
0
        public virtual ApiRetweetServerResponseModel MapEntityToModel(
            Retweet item)
        {
            var model = new ApiRetweetServerResponseModel();

            model.SetProperties(item.Id,
                                item.Date,
                                item.RetwitterUserId,
                                item.Time,
                                item.TweetTweetId);
            if (item.RetwitterUserIdNavigation != null)
            {
                var retwitterUserIdModel = new ApiUserServerResponseModel();
                retwitterUserIdModel.SetProperties(
                    item.RetwitterUserIdNavigation.UserId,
                    item.RetwitterUserIdNavigation.BioImgUrl,
                    item.RetwitterUserIdNavigation.Birthday,
                    item.RetwitterUserIdNavigation.ContentDescription,
                    item.RetwitterUserIdNavigation.Email,
                    item.RetwitterUserIdNavigation.FullName,
                    item.RetwitterUserIdNavigation.HeaderImgUrl,
                    item.RetwitterUserIdNavigation.Interest,
                    item.RetwitterUserIdNavigation.LocationLocationId,
                    item.RetwitterUserIdNavigation.Password,
                    item.RetwitterUserIdNavigation.PhoneNumber,
                    item.RetwitterUserIdNavigation.Privacy,
                    item.RetwitterUserIdNavigation.Username,
                    item.RetwitterUserIdNavigation.Website);

                model.SetRetwitterUserIdNavigation(retwitterUserIdModel);
            }

            if (item.TweetTweetIdNavigation != null)
            {
                var tweetTweetIdModel = new ApiTweetServerResponseModel();
                tweetTweetIdModel.SetProperties(
                    item.TweetTweetIdNavigation.TweetId,
                    item.TweetTweetIdNavigation.Content,
                    item.TweetTweetIdNavigation.Date,
                    item.TweetTweetIdNavigation.LocationId,
                    item.TweetTweetIdNavigation.Time,
                    item.TweetTweetIdNavigation.UserUserId);

                model.SetTweetTweetIdNavigation(tweetTweetIdModel);
            }

            return(model);
        }