// DELETE api/<controller>/5 public IHttpActionResult Delete(int id) { IHttpActionResult result = null; SubCategoryService service = new SubCategoryService(); SubCategory subCategory = service.GetSubCategory(id); if (subCategory != null) { service.RemoveSubCategory(id); result = Ok(true); } else { result = NotFound(); } return(result); }