lundi 26 janvier 2015

Handling Permutations of If Statements in C#

I have some Lists which store values. Now I want to create If-Statements to handle this but that's to much. For example:



if(list1.Count==0 && list2.Count==0)
{
//do something
}
if(list1.Count==0 && list3.Count==0)
{
//do something
}
if(list1.Count==0 && list2.Count==0 && list3.Count==0)
{
//do something
}


so there is a huge amount of if-statements if I have about 10 Lists. Is there a better way to handle that? I haven't found anything useful. Thanks!


Aucun commentaire:

Enregistrer un commentaire