public ShareCode(IShareableEntity shareableEntity) : this() { if (shareableEntity is Playlist) { EntityType = ShareableEntityType.Playlist; } EntityId = shareableEntity.Id; UrlFriendlyEntityTitle = shareableEntity.GetUrlFriendlyTitle(); ShortId = shareableEntity.GetShortId(); }
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(); }