If I take:
Dictionary<int,string> mydictionary = MyList.Where(x=> x.id == myid).ToDictionary(x => x.id, x=> x.string);
and the list Where does not return any values (none found matching those parameters), what happens to my dictionary?
I ask because I can't check if (mydictionary==null)
as mydictionary
cannot be null
.
I'm sure you're asking "Well why don't you test it yourself?", but I don't currently have access to my development environment.