public keep Addkeep([FromBody] keep keep) { if (ModelState.IsValid) { return(_repo.Add(keep)); } return(null); }
public keep Put(int id, [FromBody] keep keep) { if (ModelState.IsValid) { return(_repo.GetOneByIdAndUpdate(id, keep)); } return(null); }
void Awake() { if (instance != null) { Destroy(this.gameObject); return; } instance = this; DontDestroyOnLoad(this); Application.targetFrameRate = 60; }
public keep GetOneByIdAndUpdate(int id, keep keep) { return(_db.QueryFirstOrDefault <keep>($@" UPDATE keeps SET Img = @Img, Link = @Link, Tags = @Tags, Title = @Title, CountShare = @CountShare, CountKeep = @CountKeep, CountView = @CountView, Shared = @Shared WHERE Id = {id}; SELECT * FROM keeps WHERE id = {id};", keep)); }
//CREATEONE public keep Add(keep keep) { int id = _db.ExecuteScalar <int>($@" INSERT INTO keeps ( img, link, tags, title, userId, CountShare, CountKeep, CountView, Shared ) VALUES (@Img, @Link, @Tags, @Title,@Userid,@CountShare,@CountKeep,@CountView,@Shared)", keep); keep.Id = id; return(keep); }