public virtual ApiDirectTweetServerResponseModel MapEntityToModel( DirectTweet item) { var model = new ApiDirectTweetServerResponseModel(); model.SetProperties(item.TweetId, item.Content, item.Date, item.TaggedUserId, item.Time); if (item.TaggedUserIdNavigation != null) { var taggedUserIdModel = new ApiUserServerResponseModel(); taggedUserIdModel.SetProperties( item.TaggedUserIdNavigation.UserId, item.TaggedUserIdNavigation.BioImgUrl, item.TaggedUserIdNavigation.Birthday, item.TaggedUserIdNavigation.ContentDescription, item.TaggedUserIdNavigation.Email, item.TaggedUserIdNavigation.FullName, item.TaggedUserIdNavigation.HeaderImgUrl, item.TaggedUserIdNavigation.Interest, item.TaggedUserIdNavigation.LocationLocationId, item.TaggedUserIdNavigation.Password, item.TaggedUserIdNavigation.PhoneNumber, item.TaggedUserIdNavigation.Privacy, item.TaggedUserIdNavigation.Username, item.TaggedUserIdNavigation.Website); model.SetTaggedUserIdNavigation(taggedUserIdModel); } return(model); }
public virtual ApiDirectTweetServerResponseModel MapServerRequestToResponse( int tweetId, ApiDirectTweetServerRequestModel request) { var response = new ApiDirectTweetServerResponseModel(); response.SetProperties(tweetId, request.Content, request.Date, request.TaggedUserId, request.Time); return(response); }