Пример #1
0
 public keep Addkeep([FromBody] keep keep)
 {
     if (ModelState.IsValid)
     {
         return(_repo.Add(keep));
     }
     return(null);
 }
Пример #2
0
 public keep Put(int id, [FromBody] keep keep)
 {
     if (ModelState.IsValid)
     {
         return(_repo.GetOneByIdAndUpdate(id, keep));
     }
     return(null);
 }
Пример #3
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(this);
        Application.targetFrameRate = 60;
    }
Пример #4
0
 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));
 }
Пример #5
0
        //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);
        }