예제 #1
0
 public static UserNotificationDTO Entity2UserNotificationDto(this USER_NotificationToken entity)
 {
     return(new UserNotificationDTO
     {
         MessageId = entity.MessageId
         , Uid = entity.Uid
         , Kind = Utils.ParseEnum <eMessageKinds>(entity.MessageKindId)
         , HTMLMessage = entity.HtmlMessage
         , MessageText = entity.Text
         , PostedOn = ((DateTimeOffset)entity.AddOn).ToVerbalDateSinceNow()
         , AddOn = entity.AddOn
         , CreatorName = entity.Entity2FullName()
         , CreatorPhotoUrl = entity.Entity2PhotoUrl(Constants.ImageBaseUrl, Constants.DefaultAvatarUrl)
         , CourseName = entity.CourseName
         , RoomName = entity.RoomName
         , isRead = entity.IsRead
     });
 }
예제 #2
0
 public static string Entity2PhotoUrl(this USER_NotificationToken entity, string imageBaseUrl, string defaultAvatarUrl)
 {
     return(GetPhotoUrl(entity.PictureURL, entity.FacebookID, imageBaseUrl, defaultAvatarUrl));
 }
예제 #3
0
 public static string Entity2FullName(this USER_NotificationToken entity)
 {
     return(CombineFullName(entity.FirstName, entity.LastName, entity.Nickname));
 }