public IResult Add(Category category)
{
IResult result = BusinessRules.Run(
CheckIfCategoryNameDuplicate(category.CategoryName)
);
if (result != null) //hatalı kodlar kendi hata mesajıyla dönüyor, hatalı olmayanlara null döndük
{
return result; // hatalı logic, hata mesajı döner
}
_categoryDal.Add(category);
return new SuccessResult();
}