Beispiel #1
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);
        }
Beispiel #2
0
        public virtual ApiFollowerServerResponseModel MapServerRequestToResponse(
            int id,
            ApiFollowerServerRequestModel request)
        {
            var response = new ApiFollowerServerResponseModel();

            response.SetProperties(id,
                                   request.Blocked,
                                   request.DateFollowed,
                                   request.FollowedUserId,
                                   request.FollowingUserId,
                                   request.FollowRequestStatu,
                                   request.Muted);
            return(response);
        }