Example #1
0
        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));
        }
Example #2
0
        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);
        }