public Keep Post([FromBody] Keep keep) { if (ModelState.IsValid) { return(db.Add(keep)); } return(null); }
public Keep AddKeep([FromBody] Keep keep) { if (ModelState.IsValid) { return(_repo.Add(keep)); } return(null); }
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); }
public Keep Post([FromBody] Keep keep) { return(db.Add(keep)); }