Ejemplo n.º 1
0
 public ActionResult <Kit> Create([FromBody] Kit newKit)
 {
     try
     {
         return(Ok(_service.Create(newKit)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 2
0
 public ActionResult <Kit> Post([FromBody] Kit newData)
 {
     try
     {
         string UserEmail = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value; // req.userInfo.email
         newData.Creator = UserEmail;
         return(Ok(_service.Create(newData)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }