/// <summary>
        /// Converts this instance of <see cref="NotificationDto"/> to an instance of <see cref="Notification"/>.
        /// </summary>
        /// <param name="dto"><see cref="NotificationDto"/> to convert.</param>
        public static Notification ToEntity(this NotificationDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new Notification();

            entity.NotificationId      = dto.NotificationId;
            entity.NotificationTitle   = dto.NotificationTitle;
            entity.NotificationMessage = dto.NotificationMessage;
            entity.SentDateTime        = dto.SentDateTime;
            entity.Priority            = dto.Priority;
            entity.Sticky = dto.Sticky;

            dto.OnEntity(entity);

            return(entity);
        }