public ActionResult<Keep> Post([FromBody] Keep value) { try { var id = HttpContext.User.FindFirstValue("Id"); // THIS IS HOW YOU GET THE ID of the currently logged in user value.UserId = id; return Ok(_repo.Create(value)); } catch (Exception e) { return BadRequest(e); } }
public ActionResult <Keep> Post([FromBody] Keep value) { try { var id = HttpContext.User.FindFirstValue("Id"); value.UserId = id; return(Ok(_repo.Create(value))); } catch (Exception e) { return(BadRequest(e)); } }
internal Keep Create(Keep newKeep) { return(_repo.Create(newKeep)); }
public Keep Create(Keep newKeep) { newKeep.Id = _repo.Create(newKeep); return(newKeep); }
public Keep Create(Keep newKeep) { return(_kr.Create(newKeep)); }