Example #1
0
 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));
     }
 }
Example #2
0
 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));
     }
 }
Example #3
0
 public Vault Create(Vault newVault)
 {
     newVault.Id = _repo.Create(newVault);
     return(newVault);
 }
Example #4
0
 public Vault Create(Vault newVault)
 {
     return(_vr.Create(newVault));
 }
Example #5
0
 internal Vault Create(Vault newVault)
 {
     return(_repo.Create(newVault));
 }