Orders.com.BLL.Rules.CanDeleteCustomerRule.OnValidateAsync C# (CSharp) Method

OnValidateAsync() protected method

protected OnValidateAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        protected override async Task OnValidateAsync()
        {
            var orders = await _orderService.GetByCustomerCommand(_customerID).ExecuteAsync();
            if (orders.Value.Any())
            {
                Invalidate("This customer is associated with one or more orders and cannot be deleted.");
            }
        }
    }