public Vault Post([FromBody] Vault vault) { if (ModelState.IsValid) { return(db.Add(vault)); } return(null); }
public Vault AddVault([FromBody] Vault vault) { if (ModelState.IsValid) { return(_repo.Add(vault)); } return(null); }
public Vault Post([FromBody] Vault vault) { var user = HttpContext.User.Identity.Name; int Id; int.TryParse(user, out Id); vault.UserId = Id; return(db.Add(vault)); }
[HttpPost]//one Vault public Vault AddVault([FromBody] Vault vault) { var user = HttpContext.User; var id = user.Identity.Name; vault.UserId = id; if (ModelState.IsValid) { return(_repo.Add(vault)); } return(null); }
public Vault Post([FromBody] Vault vault) { return(db.Add(vault)); }