c# - View result of LINQ query in watch/debugger -
is there way can view result of linq query in visual studio 2010? if add query watch expression "expression cannot contain lambda expressions".
in test code i'm aggregating totals of bunch of metrics number of children , comparing sum parents value same metric (deep nested if-else). queries in if statements. how can view these values without assigning result local variable? assignment doubles line count , aside debugging here provides no benefit. have work around use view results of linq queries in debugger?
you cannot use lambda expressions in watch list in visual studio.
there couple of things can do:
create method calls desired lambda, put method call in watch statement.
set desired lambda expression variable, @ contents of variable. aware enumerate through expression, , may cause side effects.
i imagine on list of feature requests vs, msft has not done yet. helps in meantime.
Comments
Post a Comment