public ActionResult <Vault> Post([FromBody] Vault 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 <Vault> Post([FromBody] Vault value) { try { var id = HttpContext.User.FindFirstValue("Id"); value.UserId = id; return(Ok(_repo.Create(value))); } catch (Exception e) { return(BadRequest(e)); } }
public Vault Create(Vault newVault) { newVault.Id = _repo.Create(newVault); return(newVault); }
public Vault Create(Vault newVault) { return(_vr.Create(newVault)); }
internal Vault Create(Vault newVault) { return(_repo.Create(newVault)); }