Ejemplo n.º 1
0
 public void deleteTrack(DatabaseIdContent id)
 {
     using (var db = new DatabaseContext(Path))
     {
         db.MySongs.Remove(id);
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void AddTrackMySongs(DatabaseIdContent id)
 {
     using (var db = new DatabaseContext(Path))
     {
         db.MySongs.Add(id);
         db.SaveChanges();
     }
 }
 public async Task <Track> SearchTrackById(string clientId, DatabaseIdContent id)
 {
     try
     {
         var getResponse = await $"https://api.jamendo.com/v3.0/tracks/?client_id={clientId}&format=jsonpretty&id={id.id}".GetJsonAsync <JObject>();
         return(getResponse.SelectToken("results").First.ToObject <Track>());
     }
     catch (FlurlHttpException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }