public IActionResult Get() { try { return(Ok(_genderCategoryService.GetAll())); } catch (Exception) { return(BadRequest("Gender not found")); } }
public SubCategory AddSubCategory(SubCategory subCategory) { try { _context.SubCategory.Add(subCategory); _context.SaveChanges(); var list = _genderCategoryService.GetAll(); foreach (var x in list) { GenderSubCategory genderSubCategory = new GenderSubCategory { GenderCategoryID = x.ID, SubCategoryID = subCategory.ID }; _genderSubCategoryService.AddGenderSubCategory(genderSubCategory); } return(subCategory); } catch (Exception ex) { throw ex; } }
public IActionResult Get() { return(Ok(_genderCategoryService.GetAll())); }