Since you are checking Where that a.AnswerId matters, a.AnswerId.Value will never throw an InvalidOperationException (unless another thread changes data at the same time). Resharper has good code analysis capabilities, but it cannot determine everything, in which case he does not understand that Where allows you to safely call .Value in Select , therefore, this is a warning. Therefore, you can safely ignore this warning.
source share