I have the following method I would like to know how it is interpreted
if (!existe_producto(ListaProd, item1.codigo))
{
item1.Descripcion = item1.codigo + " - " + item1.Descripcion;
ListaProdx.Add(item1);
}
private bool existe_producto(List<Ex_Producto> full_codigo, long codigo)
{
try
{
bool resp = false;
foreach (var c in full_codigo)
{
if (c.codigox == codigo)
{
resp = true;
break;
}
}
return resp;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
That is, when I evaluate if(bool), that is, if my variable is equal to true, but when I say if(!bool) of a method that returns true or false, as it is read