public Data.Song ToDto() { var artists = FeaturedArtists == null ? new List <Data.Artist>() : FeaturedArtists.Select(a => a.ToDto()).ToList(); artists.Add(PrimaryArtist.ToDto()); return(new Data.Song { Id = Id, Title = Title, ReleaseDate = ReleaseDate, PrimaryArtist = PrimaryArtist.ToDto(), FeaturedArtists = FeaturedArtists == null ? null : FeaturedArtists.Select(a => a.ToDto()).ToList(), Url = Url, Lyrics = Lyrics, Media = new List <Data.Medium>(new[] { new Data.Medium { Type = Data.eMediumType.Apple, Value = AppleMusicId }, new Data.Medium { Type = Data.eMediumType.SoundCloud, Value = SoundCloudUrl }, new Data.Medium { Type = Data.eMediumType.Spotify, Value = SpotifyUuid }, new Data.Medium { Type = Data.eMediumType.YouTube, Value = YoutubeUrl } }) }); }
public static PrimaryArtist Mock(this PrimaryArtist instancePrimaryArtist) { instancePrimaryArtist = GetOneFromCollection(PrimaryArtists); return(instancePrimaryArtist); }