async public Task <ShortDeckInfo> Post(DeckCreate creation) { int creationCount = creation.Count.HasValue ? creation.Count.Value : 1; Deck deck = await _repository.CreateNewShuffledDeckAsync(creationCount); ShortDeckInfo deckInfo = new ShortDeckInfo { DeckId = deck.DeckId, Remaining = deck.Cards.Where(x => !x.Drawn).Count() }; return(deckInfo); }
public async Task <ShortDeckInfo> Post(DeckCreate model) { int count = model.Count.HasValue ? model.Count.Value : 1; var deck = await repository.CreateNewShuffledDeckAsync(count); var deckInfo = new ShortDeckInfo() { DeckId = deck.DeckId, Remaining = deck.Cards.Where(card => !card.Drawn).Count() }; return(deckInfo); }