Exemplo n.º 1
0
 public VaultKeep CreateVaultKeep([FromBody] VaultKeep newVaultKeep)
 {
     if (ModelState.IsValid)
     {
         var user = HttpContext.User;
         newVaultKeep.AuthorId = user.Identity.Name;
         return(_db.CreateVaultKeep(newVaultKeep));
     }
     return(null);
 }
Exemplo n.º 2
0
        public ActionResult <VaultKeep> Create([FromBody] VaultKeep vaultkeep)
        {
            VaultKeep newVaultKeep = _vkr.CreateVaultKeep(vaultkeep);

            if (newVaultKeep == null)
            {
                return(BadRequest());
            }
            return(Ok(newVaultKeep));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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)));
 }