Esempio n. 1
0
 public void CateInsert()
 {
     Assert.AreNotEqual(false, function.Post(new CategoryNew
     {
         name = "Công nghệ"
     }));
 }
Esempio n. 2
0
 public IActionResult Post([FromBody] CategoryNew item)
 {
     if (item == null)
     {
         return(NotFound());
     }
     else
     {
         try
         {
             if (catefunction.Post(item))
             {
                 return(Ok());
             }
             else
             {
                 return(NotFound());
             }
         }
         catch (Exception)
         {
             return(NotFound());
         }
     }
 }