public VaultKeep CreateVaultKeep([FromBody] VaultKeep newVaultKeep) { if (ModelState.IsValid) { var user = HttpContext.User; newVaultKeep.AuthorId = user.Identity.Name; return(_db.CreateVaultKeep(newVaultKeep)); } return(null); }
public ActionResult <VaultKeep> Create([FromBody] VaultKeep vaultkeep) { VaultKeep newVaultKeep = _vkr.CreateVaultKeep(vaultkeep); if (newVaultKeep == null) { return(BadRequest()); } return(Ok(newVaultKeep)); }
public ActionResult <VaultKeep> Create([FromBody] VaultKeep nVaultKeep) { nVaultKeep.UserId = HttpContext.User.Identity.Name; VaultKeep newVaultKeep = _vkr.CreateVaultKeep(nVaultKeep); if (newVaultKeep == null) { return(BadRequest("No make new VaultKeep")); } return(Ok(newVaultKeep)); }
public ActionResult <VaultKeep> Create([FromBody] VaultKeep vaultKeeper) { vaultKeeper.UserId = HttpContext.User.Identity.Name; VaultKeep newVaultKeeper = _vkr.CreateVaultKeep(vaultKeeper); if (newVaultKeeper == null) { return(BadRequest("Can't create that VAULTKeep!")); } return(Ok(newVaultKeeper)); }
public ActionResult <VaultKeep> Create([FromBody] VaultKeep newVaultKeep) { newVaultKeep.UserId = HttpContext.User.FindFirstValue("Id"); return(Ok(_repo.CreateVaultKeep(newVaultKeep))); }