protected override async Task OnValidateAsync() { var products = await _productsDataProxy.GetByCategoryAsync(_categoryID); if (products.Any()) { Invalidate("This category is associated with one or more products and cannot be deleted."); } } }