Ejemplo n.º 1
0
 public string GetAllCategory()
 {
     ICategorieRepository category = new CategorieRepository();
     var result = category.GetAll();
     var json = new JavaScriptSerializer().Serialize(result);
     return json;
 }
Ejemplo n.º 2
0
        public HttpResponseMessage PostCategoryCreate(
           [FromBody] Categorie categorie
            )
        {
            ICategorieRepository cat = new CategorieRepository();
            var result = cat.Add(categorie.Name);

            return Request.CreateResponse(HttpStatusCode.OK, result);
        }