public ActionResult <Kit> Create([FromBody] Kit newKit) { try { return(Ok(_service.Create(newKit))); } catch (Exception e) { return(BadRequest(e.Message)); } }
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)); } }