Пример #1
0
        public void tambah_kategori()
        {
            string idnya    = Guid.NewGuid().ToString();
            var    kategori = new DataModel.Category {
                Id = idnya, Name = "Apa Aja"
            };

            BusinessProcess.CategoryManager cm = new BusinessProcess.CategoryManager();
            cm.Add(kategori);
        }
Пример #2
0
 // POST: api/APICategory
 public IEnumerable <string> Post([FromBody] DataModel.Category category)
 {
     if (ModelState.IsValid)
     {
         BusinessProcess.CategoryManager cm = new BusinessProcess.CategoryManager();
         string idData = Guid.NewGuid().ToString();
         category = new DataModel.Category {
             Id = idData, Name = category.Name
         };
         var data = cm.Add(category);
         return(new string[] { "info", data });
     }
     else
     {
         return(new string[] { "info", "" });
     }
 }