public virtual ApiTweetServerResponseModel MapServerRequestToResponse(
            int tweetId,
            ApiTweetServerRequestModel request)
        {
            var response = new ApiTweetServerResponseModel();

            response.SetProperties(tweetId,
                                   request.Content,
                                   request.Date,
                                   request.LocationId,
                                   request.Time,
                                   request.UserUserId);
            return(response);
        }
Ejemplo n.º 2
0
        public virtual ApiQuoteTweetServerResponseModel MapEntityToModel(
            QuoteTweet item)
        {
            var model = new ApiQuoteTweetServerResponseModel();

            model.SetProperties(item.QuoteTweetId,
                                item.Content,
                                item.Date,
                                item.RetweeterUserId,
                                item.SourceTweetId,
                                item.Time);
            if (item.RetweeterUserIdNavigation != null)
            {
                var retweeterUserIdModel = new ApiUserServerResponseModel();
                retweeterUserIdModel.SetProperties(
                    item.RetweeterUserIdNavigation.UserId,
                    item.RetweeterUserIdNavigation.BioImgUrl,
                    item.RetweeterUserIdNavigation.Birthday,
                    item.RetweeterUserIdNavigation.ContentDescription,
                    item.RetweeterUserIdNavigation.Email,
                    item.RetweeterUserIdNavigation.FullName,
                    item.RetweeterUserIdNavigation.HeaderImgUrl,
                    item.RetweeterUserIdNavigation.Interest,
                    item.RetweeterUserIdNavigation.LocationLocationId,
                    item.RetweeterUserIdNavigation.Password,
                    item.RetweeterUserIdNavigation.PhoneNumber,
                    item.RetweeterUserIdNavigation.Privacy,
                    item.RetweeterUserIdNavigation.Username,
                    item.RetweeterUserIdNavigation.Website);

                model.SetRetweeterUserIdNavigation(retweeterUserIdModel);
            }

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

                model.SetSourceTweetIdNavigation(sourceTweetIdModel);
            }

            return(model);
        }
Ejemplo n.º 3
0
        public virtual ApiTweetServerResponseModel MapEntityToModel(
            Tweet item)
        {
            var model = new ApiTweetServerResponseModel();

            model.SetProperties(item.TweetId,
                                item.Content,
                                item.Date,
                                item.LocationId,
                                item.Time,
                                item.UserUserId);
            if (item.LocationIdNavigation != null)
            {
                var locationIdModel = new ApiLocationServerResponseModel();
                locationIdModel.SetProperties(
                    item.LocationIdNavigation.LocationId,
                    item.LocationIdNavigation.GpsLat,
                    item.LocationIdNavigation.GpsLong,
                    item.LocationIdNavigation.LocationName);

                model.SetLocationIdNavigation(locationIdModel);
            }

            if (item.UserUserIdNavigation != null)
            {
                var userUserIdModel = new ApiUserServerResponseModel();
                userUserIdModel.SetProperties(
                    item.UserUserIdNavigation.UserId,
                    item.UserUserIdNavigation.BioImgUrl,
                    item.UserUserIdNavigation.Birthday,
                    item.UserUserIdNavigation.ContentDescription,
                    item.UserUserIdNavigation.Email,
                    item.UserUserIdNavigation.FullName,
                    item.UserUserIdNavigation.HeaderImgUrl,
                    item.UserUserIdNavigation.Interest,
                    item.UserUserIdNavigation.LocationLocationId,
                    item.UserUserIdNavigation.Password,
                    item.UserUserIdNavigation.PhoneNumber,
                    item.UserUserIdNavigation.Privacy,
                    item.UserUserIdNavigation.Username,
                    item.UserUserIdNavigation.Website);

                model.SetUserUserIdNavigation(userUserIdModel);
            }

            return(model);
        }