I am extracting a bool value from a (non-generic, heterogeneous) collection.
The as operator may only be used with reference types, so it is no
Providing you don't actually need to keep a reference to the rawValue, here's a one-liner using the GetValueOrDefault() method of the Nullable
bool value = (map.GetValue(key) as bool?).GetValueOrDefault();
You can also specify a default value using the method overload GetValueOrDefault(T).