public async Task <bool> DeleteCategoryAsync(int id) { await ValidateCategory(id); await CategoriesRepository.DeleteCategoryAsync(id); if (await CategoriesRepository.SaveChangesAsync()) { return(true); } return(false); }