Method ThrowInvalidState
ThrowInvalidState(string, params BsonReaderState[])
Throws an InvalidOperationException when the method called is not valid for the current state.
Parameters
methodName
stringThe name of the method.
validStates
BsonReader []State The valid states.