/// <summary> /// adding category /// </summary> /// <param name="category"></param> /// <returns></returns> public HttpResponseMessage Post([FromBody] Category category) { HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "record inserted"); try { BusinessLayer bll = new BusinessLayer(); bll.AddCategory(category); } catch (Exception ex) { errRes = Request.CreateErrorResponse(HttpStatusCode.NotFound, "record not found"); } return(errRes); }
// Add new category private void AddCategoryAction() { BusinessLayer.AddCategory(NewCategory); }