Beispiel #1
0
        public ActionResult <VaultKeep> AddVaultKeep([FromBody] VaultKeep vaultKeep)
        {
            vaultKeep.UserId = HttpContext.User.Identity.Name;
            VaultKeep result = _repo.AddVaultKeep(vaultKeep);

            return(Created("/api/vaultkeeps/" + result.Id, result));
        }
Beispiel #2
0
        public ActionResult AddVaultKeep([FromBody] VaultKeep val)
        {
            val.UserId = HttpContext.User.Identity.Name;
            VaultKeep result = _repo.AddVaultKeep(val);

            return(Ok());
            // return Created("/api/VaultKeep/" + result.Id, result);
        }
Beispiel #3
0
        public ActionResult <string> Post([FromBody] VaultKeep vk)
        {
            var id = HttpContext.User.Identity.Name;

            vk.UserId = id;
            VaultKeep result = _vaultKeepRepo.AddVaultKeep(vk);

            return(Created("api/vaultkeep/" + result.Id, result));
        }
 public VaultKeep AddVaultKeep([FromBody] VaultKeep vaultKeepData)
 {
     if (ModelState.IsValid)
     {
         VaultKeep vaultKeep = _repo.AddVaultKeep(vaultKeepData);
         return(vaultKeep);
     }
     System.Console.WriteLine("VaulKeep Not Added");
     return(null);
 }
Beispiel #5
0
 public ActionResult <List <VaultKeep> > Post([FromBody] VaultKeep VaultKeep)
 {
     VaultKeep.UserId = HttpContext.User.Identity.Name;
     if (VaultKeep.UserId != null)
     {
         VaultKeep result = _repo.AddVaultKeep(VaultKeep);
         return(Created("api/VaultKeeps/" + result.Id, result));
     }
     return(BadRequest("Unable to create vaultkeep"));
 }
 public VaultKeep AddVaultKeep([FromBody] AddVaultKeepModel addVaultKeep)
 {
     if (ModelState.IsValid)
     {
         VaultKeep vaultKeep = _db.AddVaultKeep(addVaultKeep);
         if (vaultKeep != null)
         {
             return(vaultKeep);
         }
     }
     return(null);
 }