コード例 #1
0
        public ActionResult Create(CreateCardDto createCardDto)
        {
            try
            {
                var newCard = new Card()
                {
                    DeckId = createCardDto.DeckId,
                    Front  = createCardDto.Front,
                    Back   = createCardDto.Back,
                    Level  = createCardDto.Level
                };

                //newCard = CodeRenderHelper.DecodeCardForCode(newCard);
                deckService.AddCard(newCard);

                return(RedirectToAction(nameof(View), new { CardId = newCard.CardId }));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }