public static void ValidateResponse(IList response, IList request) { if (response is DiagnosticInfoCollection) { throw new ArgumentException("Must call ValidateDiagnosticInfos() for DiagnosticInfoCollections.", "response"); } if (response == null || response.Count != request.Count) { throw new ServiceResultException(StatusCodes.BadUnexpectedError, "The server returned a list without the expected number of elements."); } }