Ejemplo n.º 1
0
 public ActionResult <Card> Post([FromBody] Card newCard)
 {
     try
     {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         newCard.UserId = userId;
         return(Ok(_cs.Create(newCard)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }