public async Task <ObservableCollection <Event> > GetData(string id, int type) { ObservableCollection <Event> events = new ObservableCollection <Event>(); if (id == null) { id = "null"; } Event ev = new Event(); ev.Id = id; ev.Type.Id = type; string json = ""; try { DataAsync da = new DataAsync(); json = await da.GetEventAsync(ev); events = getEventCollection(json); } catch (Exception ex) { Debug.WriteLine("Excepción producida: " + ex.Message); return(null); } return(events); }
public async Task <ObservableCollection <Channel> > GetData(string id) { ObservableCollection <Channel> channels = new ObservableCollection <Channel>(); string json = ""; try { DataAsync da = new DataAsync(); json = await da.GetChannelListAsync(id); channels = getChannelCollection(json); } catch (Exception ex) { Debug.WriteLine("Excepción producida: " + ex.Message); return(null); } return(channels); }