public ActionResult <Keep> AddKeep([FromBody] Keep keep) { var id = HttpContext.User.Identity.Name; keep.UserId = id; return(Ok(_repo.AddKeep(keep))); }
public ActionResult <List <Keep> > Post([FromBody] Keep keep) { keep.UserId = HttpContext.User.Identity.Name; Keep result = _repo.AddKeep(keep); return(Created("api/keeps/" + result.Id, result)); }
public ActionResult <Keep> AddKeep(KeepModel setKeep) { var userId = HttpContext.User.Identity.Name; setKeep.UserId = userId; return(Ok(_repo.AddKeep(setKeep))); }
public Keep AddKeep([FromBody] Keep keep) { if (ModelState.IsValid) { return _repo.AddKeep (keep); } else { return null; } }
public ActionResult <string> Post([FromBody] Keep keep) { keep.UserId = HttpContext.User.Identity.Name; if (keep.UserId != null) { return(Ok(_repo.AddKeep(keep))); } return(Unauthorized()); }
public Keep Post([FromBody] Keep newKeep) { var userId = HttpContext.User.Identity.Name; newKeep.userId = userId; if (ModelState.IsValid) { return(db.AddKeep(newKeep)); } return(null); }
public ActionResult <Keep> Post([FromBody] Keep keep) { keep.UserId = HttpContext.User.Identity.Name; return(Created("/api/keeps", _keepRepo.AddKeep(keep))); }