Exemplo n.º 1
0
        public async Task <DeckWithCardOverview> AddNewDeck(MtgIdentity identity, string title, string description)
        {
            try
            {
                var data = new NewDeckData(title, description);
                _logger.LogInformation("Adding a new deck for {userId} with data {data}", identity.Id, data);
                var deck = await _deckRepository.CreateNewDeck(identity, data);

                return(await GetDeck(deck.Id));
            }
            catch (Exception ex)
            {
                throw new DeckServiceException($"Something went wrong while adding a new deck for user {identity.Id}", ex);
            }
        }
Exemplo n.º 2
0
 public static Deck New(MtgIdentity identity, NewDeckData data)
 {
     return(new (data.Title, data.Description, identity.Id));
 }