public static IEnumerable <TrainData> Query(QueryRequest request) { var queryDictionary = request.ToDictionary(); var result = ApiHelper.Get <QueryResponse>(StaticConfig.QueryApi, queryDictionary); if (!result.Status) { throw new IOException(result.Messages.FirstOrDefault()); } return(result.Data.Select(d => d.Data)); }
public static ObservableCollection <TrainData> Query(QueryRequest request) { var queryDictionary = request.ToDictionary(); var result = ApiHelper.Get <QueryResponse>(StaticConfig.QueryApi, queryDictionary); if (result == null) { throw Network.ResponseNull; } else if (!result.Status) { throw new IOException(result.Messages.FirstOrDefault()); } return(result.Data.Data); }