예제 #1
0
 /// <summary>
 /// This call returns data from a specified dataset.
 /// <a href="https://www.quandl.com/docs/api?json#get-data">Reference</a>
 /// </summary>
 /// <param name="code">Dataset code</param>
 /// <param name="limit">Use limit=n to get the first n rows of the dataset. Use limit=1 to get just the latest row.</param>
 /// <param name="columnIndex">Request a specific column. Column 0 is the date column and is always returned. Data begins at column 1.</param>
 /// <param name="startDate">Retrieve data rows on and after the specified start date.</param>
 /// <param name="endDate">Retrieve data rows up to and including the specified end date.</param>
 /// <param name="order">Return data in ascending or descending order of date. Default is “desc”.</param>
 /// <param name="collapse">Change the sampling frequency of the returned data. Default is “none” i.e. data is returned in its original granularity.</param>
 /// <param name="transform">Perform elementary calculations on the data prior to downloading. Default is “none”. Calculation options are described below.</param>
 /// <param name="token">Cancellation token</param>
 /// <returns>Get dataset response</returns>
 public async Task <GetDatasetResponse> GetAsync(DatasetCode code, int?limit = null, int?columnIndex  = null,
                                                 DateTime?startDate          = null, DateTime?endDate = null, Order?order = null, Collapse?collapse = null, Transform?transform = null, CancellationToken token = default(CancellationToken))
 => await GetAsync(code.ToPair().Item1, code.ToPair().Item2, limit, columnIndex, startDate, endDate, order, collapse, transform, token);
예제 #2
0
        public static Tuple <string, string> ToPair(this DatasetCode code)
        {
            var pair = code.ToEnumMemberValue().Split('_');

            return(new Tuple <string, string>(pair[0], pair[1]));
        }