Edit : It's controversial whether this is 'better' than the plain if..else for any given case. But if you want to try something else this is a common way of doing it.
Put your conditions in objects and put those objects in a list
foreach(var condition in Conditions.OrderBy(i=>i.OrderToRunIn)) { if(condition.EvaluatesToTrue()) { addAlert(condition.Alert); break; } } Edit --
ifIf multiple actions are required on condition you can do some crazy recursion
void RunConditionalAction(ConditionalActionSet conditions) { foreach(var condition in conditions.OrderBy(i=>i.OrderToRunIn)) { if(condition.EvaluatesToTrue()) { RunConditionalAction(condition); break; } } } Obviously yes. This only works if you have a pattern to your logic. If you try to make a super generic recursive conditional action then the setup for the object will be as complicated as the original if statement. You will be inventing your own new language/framework.
But your example does have a pattern
Edit --
A common use case for this pattern would be validation. Instead of :
bool IsValid() { if(condition1 == false) { throw new ValidationException("condition1 is wrong!"); } elseif(condition2 == false) { .... } Becomes
[MustHaveCondition1] [MustHaveCondition2] public myObject() { [MustMatchRegExCondition("xyz")] public string myProperty {get;set;} public bool IsValid() { conditions = getConditionsFromReflection() //loop through conditions } }