Esempio n. 1
0
        public virtual ApiReplyServerResponseModel MapEntityToModel(
            Reply item)
        {
            var model = new ApiReplyServerResponseModel();

            model.SetProperties(item.ReplyId,
                                item.Content,
                                item.Date,
                                item.ReplierUserId,
                                item.Time);
            if (item.ReplierUserIdNavigation != null)
            {
                var replierUserIdModel = new ApiUserServerResponseModel();
                replierUserIdModel.SetProperties(
                    item.ReplierUserIdNavigation.UserId,
                    item.ReplierUserIdNavigation.BioImgUrl,
                    item.ReplierUserIdNavigation.Birthday,
                    item.ReplierUserIdNavigation.ContentDescription,
                    item.ReplierUserIdNavigation.Email,
                    item.ReplierUserIdNavigation.FullName,
                    item.ReplierUserIdNavigation.HeaderImgUrl,
                    item.ReplierUserIdNavigation.Interest,
                    item.ReplierUserIdNavigation.LocationLocationId,
                    item.ReplierUserIdNavigation.Password,
                    item.ReplierUserIdNavigation.PhoneNumber,
                    item.ReplierUserIdNavigation.Privacy,
                    item.ReplierUserIdNavigation.Username,
                    item.ReplierUserIdNavigation.Website);

                model.SetReplierUserIdNavigation(replierUserIdModel);
            }

            return(model);
        }
Esempio n. 2
0
        public virtual ApiMessageServerResponseModel MapEntityToModel(
            Message item)
        {
            var model = new ApiMessageServerResponseModel();

            model.SetProperties(item.MessageId,
                                item.Content,
                                item.SenderUserId);
            if (item.SenderUserIdNavigation != null)
            {
                var senderUserIdModel = new ApiUserServerResponseModel();
                senderUserIdModel.SetProperties(
                    item.SenderUserIdNavigation.UserId,
                    item.SenderUserIdNavigation.BioImgUrl,
                    item.SenderUserIdNavigation.Birthday,
                    item.SenderUserIdNavigation.ContentDescription,
                    item.SenderUserIdNavigation.Email,
                    item.SenderUserIdNavigation.FullName,
                    item.SenderUserIdNavigation.HeaderImgUrl,
                    item.SenderUserIdNavigation.Interest,
                    item.SenderUserIdNavigation.LocationLocationId,
                    item.SenderUserIdNavigation.Password,
                    item.SenderUserIdNavigation.PhoneNumber,
                    item.SenderUserIdNavigation.Privacy,
                    item.SenderUserIdNavigation.Username,
                    item.SenderUserIdNavigation.Website);

                model.SetSenderUserIdNavigation(senderUserIdModel);
            }

            return(model);
        }
Esempio n. 3
0
        public virtual ApiUserServerResponseModel MapEntityToModel(
            User item)
        {
            var model = new ApiUserServerResponseModel();

            model.SetProperties(item.UserId,
                                item.BioImgUrl,
                                item.Birthday,
                                item.ContentDescription,
                                item.Email,
                                item.FullName,
                                item.HeaderImgUrl,
                                item.Interest,
                                item.LocationLocationId,
                                item.Password,
                                item.PhoneNumber,
                                item.Privacy,
                                item.Username,
                                item.Website);
            if (item.LocationLocationIdNavigation != null)
            {
                var locationLocationIdModel = new ApiLocationServerResponseModel();
                locationLocationIdModel.SetProperties(
                    item.LocationLocationIdNavigation.LocationId,
                    item.LocationLocationIdNavigation.GpsLat,
                    item.LocationLocationIdNavigation.GpsLong,
                    item.LocationLocationIdNavigation.LocationName);

                model.SetLocationLocationIdNavigation(locationLocationIdModel);
            }

            return(model);
        }
Esempio n. 4
0
        public virtual ApiFollowerServerResponseModel MapEntityToModel(
            Follower item)
        {
            var model = new ApiFollowerServerResponseModel();

            model.SetProperties(item.Id,
                                item.Blocked,
                                item.DateFollowed,
                                item.FollowedUserId,
                                item.FollowingUserId,
                                item.FollowRequestStatu,
                                item.Muted);
            if (item.FollowedUserIdNavigation != null)
            {
                var followedUserIdModel = new ApiUserServerResponseModel();
                followedUserIdModel.SetProperties(
                    item.FollowedUserIdNavigation.UserId,
                    item.FollowedUserIdNavigation.BioImgUrl,
                    item.FollowedUserIdNavigation.Birthday,
                    item.FollowedUserIdNavigation.ContentDescription,
                    item.FollowedUserIdNavigation.Email,
                    item.FollowedUserIdNavigation.FullName,
                    item.FollowedUserIdNavigation.HeaderImgUrl,
                    item.FollowedUserIdNavigation.Interest,
                    item.FollowedUserIdNavigation.LocationLocationId,
                    item.FollowedUserIdNavigation.Password,
                    item.FollowedUserIdNavigation.PhoneNumber,
                    item.FollowedUserIdNavigation.Privacy,
                    item.FollowedUserIdNavigation.Username,
                    item.FollowedUserIdNavigation.Website);

                model.SetFollowedUserIdNavigation(followedUserIdModel);
            }

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

                model.SetFollowingUserIdNavigation(followingUserIdModel);
            }

            return(model);
        }
        public virtual ApiUserServerResponseModel MapServerRequestToResponse(
            int userId,
            ApiUserServerRequestModel request)
        {
            var response = new ApiUserServerResponseModel();

            response.SetProperties(userId,
                                   request.BioImgUrl,
                                   request.Birthday,
                                   request.ContentDescription,
                                   request.Email,
                                   request.FullName,
                                   request.HeaderImgUrl,
                                   request.Interest,
                                   request.LocationLocationId,
                                   request.Password,
                                   request.PhoneNumber,
                                   request.Privacy,
                                   request.Username,
                                   request.Website);
            return(response);
        }