Example #1
0
        public void FindCardWithApi(Card card)
        {
            List <mtgCard.Card> listOfResults = new List <mtgCard.Card>();

            mtgService.CardService apiService = new mtgService.CardService();

            var searchResults = apiService.Where(x => x.Name, card.Name)
                                .All();

            if (searchResults.Value.Count != 0)
            {
                var sets = searchResults.Value[0].Printings;
            }
        }
Example #2
0
        public bool CreateCard(CardCreate model)
        {
            var entity = new Card()
            {
                OwnerId = _userId,
                Name    = model.CardName
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.Cards.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }