I need to check if listaContrato
items exist in listaPendencia
, if there is no enable
to false to be disabled on the screen.
What can I do to improve the performance of foreach
below? Both lists are List<>
.
If there are solutions that are not foreach
, they are also welcome.
foreach (System.Windows.Controls.CheckBox item in pendenciaController.ListaCliente)
{
item.IsEnabled = false;
foreach (Pendencia pendencia in pendenciaController.ListaPendencia)
{
if (pendencia.ClienteNome.Equals(item.Content))
{
item.IsEnabled = true;
break;
}
}
}