Example #1
0
        public async Task <IActionResult> UpdateOrders(string regionId)
        {
            var authHeader = Request.Headers["Authorization"][0].Split(" ")[1];
            var uri        = new Uri($"https://esi.tech.ccp.is/latest/markets/{regionId}/orders");

            var data = await HttpClientHelper.GetObjects <MarketOrderModel>(uri, authHeader);

            _marketOrders.DeleteAll();
            _marketOrders.Insert(data);

            return(Json(data));
        }
Example #2
0
        public async Task <IActionResult> UpdateHistoryOrders(string regionId, string typeId)
        {
            var authHeader = Request.Headers["Authorization"][0].Split(" ")[1];
            var uri        = new Uri($"https://esi.tech.ccp.is/latest/markets/{regionId}/history?type_id={typeId}");

            var data = await HttpClientHelper.GetObjects <MarketHistoryModel>(uri, authHeader);

            data.ForEach(x => { x.region_id = long.Parse(regionId); x.type_id = long.Parse(typeId); });

            _marketHistory.Insert(data);

            return(Json(data));
        }
Example #3
0
        public async Task <IActionResult> UpdateCharacterOrders(string characterId)
        {
            var authHeader = Request.Headers["Authorization"][0].Split(" ")[1];
            var uri        = new Uri($"https://esi.tech.ccp.is/latest/characters/{characterId}/orders");

            var data = await HttpClientHelper.GetObjects <CharacterOrdersModel>(uri, authHeader);

            data.ForEach(x => x.character_id = long.Parse(characterId));

            _marketCharacterOrders.Insert(data);

            return(Json(data));
        }