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 }); }
public static string Entity2PhotoUrl(this USER_NotificationToken entity, string imageBaseUrl, string defaultAvatarUrl) { return(GetPhotoUrl(entity.PictureURL, entity.FacebookID, imageBaseUrl, defaultAvatarUrl)); }
public static string Entity2FullName(this USER_NotificationToken entity) { return(CombineFullName(entity.FirstName, entity.LastName, entity.Nickname)); }