public async Task <List <OptionModel> > Options([FromBody] dynamic data)
    {
        var selectors = data.ToObject <QueryModel>();

        var optionModel = new OptionModel
        {
            Symbol     = "MSFT",
            Expiration = "201806"
        };

        var processes = new List <Task <List <OptionModel> > >
        {
            Service.GetOptionsChain(optionModel)
        };

        return((await Task.WhenAll(processes)).SelectMany(o => o).ToList());
    }
Beispiel #2
0
    public List <OptionModel> Options([FromBody] dynamic data)
    {
        var selectors = data.ToObject <QueryModel>();

        var optionModel = new OptionModel
        {
            Symbol     = "MSFT",
            Expiration = "201806"
        };

        var optionService = new OptionService();

        var processes = new List <Task <List <OptionModel> > >
        {
            optionService.GetOptionsChain(optionModel)
        };

        var items = Task.WhenAll(processes).Result.SelectMany(o => o).ToList();

        optionService.Dispose(); // Ridiculous fix for ridiculous API

        return(items);
    }