Ejemplo n.º 1
0
 public void AddTag(WorkspaceCard workspaceCard, Tag tag)
 {
     if (!workspaceCard.TagIds.Any(tId => tId == tag.Id))
     {
         workspaceCard.TagIds.Add(tag.Id);
     }
     //Throw exception
 }
Ejemplo n.º 2
0
        public void AddCard(Card card)
        {
            var nextId = Id <WorkspaceCard> .GetNextId(WorkspaceCards);

            var workspaceCard = new WorkspaceCard(nextId, card);

            if (!WorkspaceCards.Any(wc => wc.CardId == card.Id))
            {
                WorkspaceCards.Add(workspaceCard);
            }
        }
Ejemplo n.º 3
0
        public void AddToDeck(WorkspaceCard workspaceCard)
        {
            if (!DeckCards.Any(dc => dc.WorkspaceCardId == workspaceCard.Id))
            {
                var nextId = Id <DeckCard> .GetNextId(DeckCards);

                var deckCard = new DeckCard(nextId, workspaceCard.Id, 1);
                DeckCards.Add(deckCard);
            }
            else
            {
                var deckCard = DeckCards.Find(dc => dc.WorkspaceCardId == workspaceCard.Id);
                //deckCard.Quantity++;
            }
        }