public ActionResult Create(Card card)
        {
            if (ModelState.IsValid)
            {
                _cardService.Add(card);

                return RedirectToAction("Index");
            }

            ViewBag.PlayerIdList = new SelectList(db.Players, "PlayerId", "FullName", card.PlayerId);
            return View(card);
        }
 private void ChangeQuantityForCardInStore(Card card, int quantity)
 {
     card.Quantity += quantity;
     _cardService.Update(card);
 }
 public void Update(Card card)
 {
     DbContext.Entry(card).State = EntityState.Modified;
     DbContext.SaveChanges();
 }
 public void Delete(Card card)
 {
     DbContext.Cards.Remove(card);
     DbContext.SaveChanges();
 }
 public void Add(Card card)
 {
     DbContext.Cards.Add(card);
     DbContext.SaveChanges();
 }
        public ActionResult Edit(Card card)
        {
            if (ModelState.IsValid)
            {
                _cardService.Update(card);

                return RedirectToAction("Index");
            }
            ViewBag.PlayerIdList = new SelectList(db.Players.AsNoTracking(), "PlayerId", "FullName", card.PlayerId);
            return View(card);
        }