public Keep CreateKeep(int id, [FromBody] Keep newKeep) { if (ModelState.IsValid) { newKeep.AuthorId = HttpContext.User.Identity.Name; return(_db.CreateKeep(newKeep)); } return(null); }
public ActionResult <Keep> Create([FromBody] Keep keepy) { Keep newKeepy = _kr.CreateKeep(keepy); if (newKeepy == null) { return(BadRequest("Can't create that Keep!")); } return(Ok(newKeepy)); }
public ActionResult <Keep> Create([FromBody] Keep nKeep) { nKeep.UserId = HttpContext.User.Identity.Name; Keep newKeep = _kr.CreateKeep(nKeep); if (newKeep == null) { return(BadRequest("No make new Keep")); } return(Ok(newKeep)); }