Exemplo n.º 1
0
 public ActionResult <Card> Put([FromBody] Card update)
 {
     try
     {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         update.UserId = userId;
         return(Ok(_cs.Edit(update)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 2
0
 private void BtnSave_Click(object sender, EventArgs e)
 {
     if (_cardsService.Edit(_topic, _category, _deck, new Card()
     {
         Id = _card.Id,
         Title = tbTitle.Text,
         Question = tbQuestion.Text,
         Answer = tbAnswer.Text
     }))
     {
         ToggleEditMode(false);
     }
 }