LINQ, "Value cannot be null", yet query evaluates -
i have following linq query:
var test = vendorcontact.vendorcontactitem .where(x => x.itemnumber == vendorcontactitem.item_number) .firstordefault();
it fails on piece of code, "value cannot null, parameter name: source" ... yet displays, in local variables window, "test" variable properties populated.
vendorcontact.vendorcontactitem
is null. presumably first element added list. how "test" evaluating correctly while simultaneously throwing error?
i'm new linq, excuse me if obvious question.
if in loop test
in locals window contains last value of test
, last iteration of loop.
edit: has nothing linq, how debugger works.
Comments
Post a Comment