public IActionResult Post([FromBody] SubCategory subCategory) { if (subCategory == null) { return(BadRequest()); } else if (subCategory.Id == 0) { _subCatService.AddSubCategory(subCategory); return(Ok()); } else { _subCatService.EditSubCategory(subCategory); return(Ok()); } }