Is it possible to use Linq within a conditional breakpoint?
I'm attempting to break when the following condition is true:
parentElement.ChildElements.Any(c => c.Id == 1)
When ever the debugger is hit the following error message is displayed
The debugger is unable to evaluate this expression.
I have tried the following condition in case the issue was related to using .Any()
parentElement.ChildElements.Where(c => c.Id == 1).Count() > 0
This resulted in the same error as above being displayed.
I know a work around would be the following code
#if DEBUG
if(parentElement.ChildElements.Any(c => c.Id == 1))
{
System.Diagnostics.Debugger.Break();
}
#endif
However, I would ideally not like to make code changes to place a debugger.