public void CreateBase(string native, string foreign, Guid collectionId)
 {
     FlashcardModel = new FlashcardModel()
     {
         Native            = native,
         Foreign           = foreign,
         CollectionModelId = collectionId
     };
 }
Exemplo n.º 2
0
        public IActionResult AddFlashcard(FlashcardModel model)
        {
            string message = "";

            if (ModelState.IsValid)
            {
                var addition = new FlashcardDTO
                {
                    FrontSide = model.FrontSide,
                    BackSide  = model.BackSide
                };

                services.AddFlashcard(addition);

                message = "Flashcard was added successfully:\n\n"
                          + "front side: " + model.FrontSide
                          + "\n back side: " + model.BackSide;
            }
            else
            {
                message = "Failed to create the flashcard. Please try again";
            }
            return(Content(message));
        }
 public void Reset() => FlashcardModel = new FlashcardModel();