I reviewed code and I found this operator & is there any difference with && if I want to change to &&
public bool isTemplate(string template)
{
return (isValid() & lc.templates.Any(x => x.Id.Equals(template, StringComparison.Current)));
}
I reviewed code and I found this operator & is there any difference with && if I want to change to &&
public bool isTemplate(string template)
{
return (isValid() & lc.templates.Any(x => x.Id.Equals(template, StringComparison.Current)));
}
From documentation:
&
operator always evaluates both operands.
&&
operator evaluates the right-hand operand only if it's necessary.