Exemplo n.º 1
0
        // GET: Admin/Options
        public ActionResult Index()
        {
            //return RedirectToAction("Edit");
            IList <Options> option = _optionsService.GetOptions();

            return(View(option));
        }
Exemplo n.º 2
0
            public async Task <OptionDetailsViewModel> Handle(Query request, CancellationToken cancellationToken)
            {
                var price = await _stocks.GetPrice(request.Ticker);

                if (!price.IsOk || price.Success.NotFound)
                {
                    return(null);
                }

                var dates = await _options.GetOptions(request.Ticker);

                var upToFour = dates.Take(4);

                var options = new List <OptionDetail>();

                foreach (var d in upToFour)
                {
                    var details = await _options.GetOptionDetails(request.Ticker, d);

                    options.AddRange(details);
                }

                return(MapOptionDetails(price.Success.Amount, options));
            }