protected override void OnValidate() { var products = _productsDataProxy.GetByCategory(_categoryID); if (products.Any()) { Invalidate("This category is associated with one or more products and cannot be deleted."); } }