Beispiel #1
0
        public ViewResult Edit(int DeckId)
        {
            var dck = deckService.GetDeck(DeckId);
            var res = deckService.GetResource(dck.ResourceId);
            var ed  = new EditDeckDto
            {
                DeckId        = dck.DeckId,
                ResourceId    = dck.ResourceId,
                IsShared      = dck.IsShared,
                Title         = dck.Title,
                ResourceTitle = res.Title
            };

            return(View(ed));
        }
        public ActionResult <IList <CardReadDto> > GetCurrentDeck()
        {
            var currentDeck = _service.GetDeck();

            if (currentDeck == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <IList <CardReadDto> >(currentDeck)));
        }
        public ViewResult Clone(int CardId)
        {
            var crd        = deckService.GetCard(CardId);
            var dck        = deckService.GetDeck(crd.DeckId);
            var newCardDto = new CreateCardDto
            {
                DeckId    = dck.DeckId,
                DeckTitle = dck.Title,
                Front     = crd.Front,
                Back      = crd.Back,
                Level     = crd.Level
            };

            return(View("Create", newCardDto));
        }
        public async Task <IActionResult> GetSingleDeck(Guid id)
        {
            var deck = await _deckService.GetDeck(id);

            return(Ok(deck));
        }