Ejemplo n.º 1
0
        public ShareCode(IShareableEntity shareableEntity)
            : this()
        {
            if (shareableEntity is Playlist)
            {
                EntityType = ShareableEntityType.Playlist;
            }

            EntityId = shareableEntity.Id;
            UrlFriendlyEntityTitle = shareableEntity.GetUrlFriendlyTitle();
            ShortId = shareableEntity.GetShortId();
        }
Ejemplo n.º 2
0
        public ShareCode(IShareableEntity shareableEntity)
            : this()
        {
            if (!(shareableEntity is Playlist))
            {
                throw new NotSupportedException("Only Playlists are shareable currently.");
            }

            EntityType             = ShareableEntityType.Playlist;
            EntityId               = shareableEntity.Id;
            UrlFriendlyEntityTitle = shareableEntity.GetUrlFriendlyTitle();
            ShortId = shareableEntity.GetShortId();
        }