예제 #1
0
        /// <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);
        }
예제 #2
0
 // Add new category
 private void AddCategoryAction()
 {
     BusinessLayer.AddCategory(NewCategory);
 }