Пример #1
0
        public async Task <IEnumerable <DeckOverview> > GetAllDecks(MtgIdentity identity)
        {
            try
            {
                _logger.LogInformation("Getting all decks for user {userId}", identity.Id);
                var decks = await _deckRepository.GetDecks(identity);

                return(decks.Select(m => new DeckOverview(m.Id, m.Title)));
            }
            catch (Exception ex)
            {
                throw new DeckServiceException($"Something went wrong while retrieving decks for user {identity.Id}", ex);
            }
        }
Пример #2
0
        public IActionResult Index()
        {
            var decks = _deckRepository.GetDecks();

            return(View(decks));
        }