Beispiel #1
0
        public async Task <ActionResult <IEnumerable <CardDto> > > SyncCardsAsync()
        {
            HttpClient client = new HttpClient();
            var        result = await client.GetStringAsync("https://www.shenronslair.com/api/Cards");

            var cards = JsonConvert.DeserializeObject <IEnumerable <CardDto> >(result);

            _cardBusiness.AddRange(cards);

            return(Ok(_mapper.Map <IEnumerable <CardDto> >(_cardBusiness.Get())));
        }