Exemple #1
0
 public Keep CreateKeep(int id, [FromBody] Keep newKeep)
 {
     if (ModelState.IsValid)
     {
         newKeep.AuthorId = HttpContext.User.Identity.Name;
         return(_db.CreateKeep(newKeep));
     }
     return(null);
 }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }