Esempio n. 1
0
        public static ReviewMessageDTO AuthorDto2ReviewMessageDto(this CRS_ReviewAuthorMessageToken token)
        {
            if (token == null)
            {
                return(null);
            }

            return(new ReviewMessageDTO
            {
                AddOn = token.ReviewDate ?? DateTime.Now
                , ReviewText = token.ReviewText
                , Item = new ItemMessageDTO
                {
                    id = token.CourseId
                    , name = token.CourseName
                    , itemUrlName = token.CourseUrlName
                    , desc = token.CourseDescription
                    , thumbUrl = String.IsNullOrEmpty(token.CourseThumbUrl) ? string.Empty : Constants.ImageBaseUrl + token.CourseThumbUrl
                }
                , Author = new MessageUserDTO
                {
                    id = token.AuthorUserId
                    , email = token.AuthorEmail
                    , fbUid = !String.IsNullOrEmpty(token.AuthorFacebookID) ? Int64.Parse(token.AuthorFacebookID) : (long?)null
                    , name = token.Entity2AuthorFullName()
                }
                , Writer = new MessageUserDTO
                {
                    id = token.ReviewWriterId
                    , name = token.Entity2WriterFullName()
                }
            });
        }
Esempio n. 2
0
 public static string Entity2WriterFullName(this CRS_ReviewAuthorMessageToken entity)
 {
     return(CombineFullName(entity.ReviewWriterFirstName, entity.ReviewWriterLastName, entity.ReviewWriterNickname));
 }