示例#1
0
 public Keep Post([FromBody] Keep keep)
 {
     if (ModelState.IsValid)
     {
         return(db.Add(keep));
     }
     return(null);
 }
示例#2
0
 public Keep AddKeep([FromBody] Keep keep)
 {
     if (ModelState.IsValid)
     {
         return(_repo.Add(keep));
     }
     return(null);
 }
示例#3
0
        public Keep Post([FromBody] Keep keep)
        {
            var user = HttpContext.User.Identity.Name;
            int Id;

            int.TryParse(user, out Id);
            keep.UserId = Id;
            return(db.Add(keep));
        }
        public Keep AddKeep([FromBody] Keep keep)
        {
            var user = HttpContext.User;
            var id   = user.Identity.Name;

            keep.UserId = id;
            if (ModelState.IsValid)
            {
                return(_repo.Add(keep));
            }
            return(null);
        }
示例#5
0
 public Keep Post([FromBody] Keep keep)
 {
     return(db.Add(keep));
 }