Esempio n. 1
0
        public async Task <IEnumerable <CardWithSymbols> > Post([FromBody] FormViewModel form)
        {
            // TODO(CD): Lazy so re-using the CardDto. Since the CardDto is the model the db table is based off,
            // we should probably create a new specific DTO returning only the data we need on the frontend
            var response = await _mtgHttpClient.GetCardByName(form.Name);

            var cardList = _mapper.Map <List <CardWithSymbols> >(response);

            // TODO(CD): Will be nicer when we extract the card stuff into a repo
            cardList.ForEach(IncludeSymbolsWithCard);

            return(cardList);
        }