public static Track ToEntity(this JsonLookTrack track) { Album al = new Album(track.Album.Name, track.Album.Link, track.Album.Released); List <Artist> ar = track.Artist.Select(x => new Artist(x.Name, x.Link)).ToList(); return(new Track(track.Name, track.Link, track.Duration, ar, al)); }
public Track Track(string id) { string link = string.Format("spotify:track:{0}", id); string json = lookup(link); if (json == null) { return(null); } JsonLookTrack obj = JsonConvert.DeserializeObject <Reply>(json).track; return(obj.ToEntity()); }