// POST api/<controller> public IHttpActionResult Post(CategoryView c) { var newCate = new Category { ID = c.ID, CateName = c.CateName, ID_root = c.ID_root }; var res = Repositories.CreateCate(newCate); if (res == true) { return(Ok()); } return(InternalServerError()); }
public bool CreateCategory(CategoryContract newCate) { Category cate = new Category { nameCate = newCate.nameCate }; if (Repositories.CreateCate(cate) == true) { return(true); } return(false); }