Exemple #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);
        }
        public virtual ApiReplyServerResponseModel MapServerRequestToResponse(
            int replyId,
            ApiReplyServerRequestModel request)
        {
            var response = new ApiReplyServerResponseModel();

            response.SetProperties(replyId,
                                   request.Content,
                                   request.Date,
                                   request.ReplierUserId,
                                   request.Time);
            return(response);
        }