mercredi 11 septembre 2019

Check multiple multiple similar conditions with && inside if

row has many columns, some of them are of list from. I need to check the following only for list type columns:

if(row.columm1.Count == 0 && row.column2.Count == 0 && row.column3.Count == 0 && row.column4.Count ==0){ //do something }

if(row.columm1.Count == 0 && row.column2.Count == 0 && row.column3.Count == 0 && row.column4.Count ==0){ //do something }

How can I shorten the if-statement

Aucun commentaire:

Enregistrer un commentaire