/// <summary>
        /// Gets the quotes for the specified WKN.
        /// </summary>
        /// <param name="wkn">The WKN.</param>
        /// <param name="since">The minimum date for getting quotes (including).</param>
        /// <returns></returns>
        public IEnumerable <IQuotation> Get(string wkn, DateTime since)
        {
            var result = Enumerable.Empty <IQuotation>();

            try
            {
                long msec = 0;
                using (new TimeMeasure(t => msec = t))
                {
                    var provider = new QuotationDownloadBoerseDuesseldorf();

                    result = provider
                             .Initialize(wkn, $"http://www.boerse-duesseldorf.de/aktien/wkn/{wkn}/historische_kurse")
                             .Download()
                             .ExtractInformation(since);
                }

                _loggingService.Debug($"Downloaded quotes for {wkn} in {msec / 1000} seconds");
            }
            catch (Exception ex)
            {
                _loggingService.Error($"Download of quotes for {wkn} failed with message '{ex.Message}'");
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Gets the quotes for the specified WKN.
        /// </summary>
        /// <param name="wkn">The WKN.</param>
        /// <returns></returns>
        public IEnumerable <IQuotation> Get(string wkn)
        {
            IEnumerable <IQuotation> result;

            long msec = 0;

            using (new TimeMeasure(t => msec = t))
            {
                var provider = new QuotationDownloadBoerseDuesseldorf();

                result = provider
                         .Initialize(wkn, $"http://www.boerse-duesseldorf.de/aktien/wkn/{wkn}/historische_kurse")
                         .Download()
                         .ExtractInformation();
            }

            _loggingService.Debug($"Downloaded quotes for {wkn} in {msec / 1000} seconds");

            return(result);
        }