public static IDocumentQuery <T> ConditionalWaitForNonStaleResults <T>(this IDocumentQuery <T> query, bool condition, TimeSpan waitTimeout) { if (condition) { return(query.WaitForNonStaleResults(waitTimeout)); } return(query); }