Example #1
0
        public ActionResult <Keep> AddKeep([FromBody] Keep keep)
        {
            var id = HttpContext.User.Identity.Name;

            keep.UserId = id;
            return(Ok(_repo.AddKeep(keep)));
        }
Example #2
0
        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));
        }
Example #3
0
        public ActionResult <Keep> AddKeep(KeepModel setKeep)
        {
            var userId = HttpContext.User.Identity.Name;

            setKeep.UserId = userId;
            return(Ok(_repo.AddKeep(setKeep)));
        }
Example #4
0
 public Keep AddKeep([FromBody] Keep keep)
 {
     if (ModelState.IsValid) {
     return _repo.AddKeep (keep);
       } else {
     return null;
       }
 }
Example #5
0
 public ActionResult <string> Post([FromBody] Keep keep)
 {
     keep.UserId = HttpContext.User.Identity.Name;
     if (keep.UserId != null)
     {
         return(Ok(_repo.AddKeep(keep)));
     }
     return(Unauthorized());
 }
Example #6
0
        public Keep Post([FromBody] Keep newKeep)
        {
            var userId = HttpContext.User.Identity.Name;

            newKeep.userId = userId;
            if (ModelState.IsValid)
            {
                return(db.AddKeep(newKeep));
            }
            return(null);
        }
Example #7
0
 public ActionResult <Keep> Post([FromBody] Keep keep)
 {
     keep.UserId = HttpContext.User.Identity.Name;
     return(Created("/api/keeps", _keepRepo.AddKeep(keep)));
 }