Пример #1
0
 public int addProsesor(RefProsesor item)
 {
     if (cnn.QueryFirstOrDefault <RefProsesor>("SELECT * FROM `ref. prosesor` WHERE Prosesor = '" + item.Prosesor + "';") == null)
     {
         string sql = "INSERT INTO `ref. prosesor`(Prosesor) VALUES ('" + item.Prosesor + "')";
         return(cnn.Execute(sql));
     }
     return(0);
 }
Пример #2
0
 public IActionResult Prosesor([FromBody] RefProsesor item)
 {
     if (repo.addProsesor(item) > 0)
     {
         return(Ok(okPost));
     }
     else
     {
         return(NotFound(post));
     }
 }