public HttpResponseMessage DeleteCategory(int id) { var categoryExists = _categoryDal.GetAllCategories().Any(c => c.Id == id); if (!categoryExists) { return(Request.CreateResponse(HttpStatusCode.BadRequest, new { Message = "Category doesn't exist" })); } _categoryDal.DeleteCategory(id); return(Request.CreateResponse(HttpStatusCode.Created, new { Message = "Category has been deleted" })); }
public bool Delete(int _id) { return(_efCategoryDal.DeleteCategory(_id)); }