score:0

i made a couple of changes suggested in the comments above, and also defined the contact explicitly and it now loads the contact from the database fine. i'm really confused as to why as it's basically just refactoring, but the following is working:

namespace.models.contact contact = context.contacts.firstordefault(x => x.uniqueid == identifier);

//if identifier isn't recognised return.
if (contact == default(namespace.models.contact)) 
{ 
     return "identifier not recognised. check correct type and identifier"; 
}

the fact that this working code is no different functionally to the code posted in my question confuses me. i guess it must have been something my vs was doing instead.

alex pavlov in the comments points to https://weblog.west-wind.com/posts/2013/nov/21/visual-studio-2013-could-not-evaluate-expression-debugger-abnormality

this code is perfectly fine, i might have fixed it by restarting vs if it was simply that behaving strangely.


Related Query

More Query from same tag